[bugfix #909] cache shell calls to ImageMagick

Add shell call caching to ImageMagickCommandlineBase()