Gallery template initialization