some refactoring + wip of image gallery