Use exif_imagetype to check image format instead of extension name