massive refactoring on swipe/galeria