modified the index and gallery layout