refactored gallery management out of web project