add support for imagemagick with graphicsMagick

these two commits clean up code and add support for gm.  graphicsMagick is a fork of imagemagick with improved performance.

After completing this fix I was able to ingest 400mb tif without issues.

to use/test graphicsMagick support
apt-get install graphicsmagick-imagemagick-compat
in module ImageMagick change convert path to /usr/bin/gm and check graphicsMagick support.