Validates image to avoid imagine exception