make sure that the file is an image