refactored gallery to load index files

updated