Fix a Bug on Gallery template