Move some functions in gallery