refactoring a little and working on gallery align