validate for images