Imagemagick is a popular utility for manipulation of image files within scripts and is often used by image galleries.
The ImageMagick files are installed in /usr/local/bin however, different scripts may require different ways of providing the path so it's recommended each of the following are tried if unsuccessful the first time:
Mogrify: /usr/local/bin/mogrify
Convert: /usr/local/bin/convert
Identify: /usr/local/bin/identify