Fix gallery tests after refactoring