Convert all images to JPEG, check if an uploaded file is an image