refactor some crappy code for photo gallery group collection