Fix gallery single template issue