Changed the validation of images