Implemented gallery related stuff