Fix caching photos on validation errors