fixed issue with persisting the image on validation errors.