Added correct validation for images