validate size and type of photo