Changed Imagemagick calls so that by default, image width & height data are not needed.
Removed excessive calls to getimagesize, with associated passing of width & height. Placed call within the only function in which it is needed - if it fails, use default.
Reduced code duplication in call to convert function.