Fix validation errors with image attachments