improve html structure in gallery