Only upload image if other form inputs pass validation