adding validation for images