fix for sanitize_image