Added constructor parameter for turning off upscaling. Added automatic format detection if exif_imagetype() is available.