Check for ImageMagick using "which convert" instead of extension_loaded('imagemagick').