Handle errors from imagecreatefrom* functions where the extension does not match the files mimeType