resolving error with blank image field when creating a gallery