Processing images is extremely slow

Oh sorry, totally forgot to mention this.

The server is a Raspberry Pi 3 Model B+, running Raspbian Stretch, kernel version 4.14.98-v7+