add more conditions to check validity of the submitted image