implemented gallery controller