added comment headers for all methods in gallery controller and start abstration of page date