Fix gallery form and layout views.
Fix upgrade for new gallery options.