Validate image type and show error on failure