secured exif_imagetype function