Fix the gallery toc structure