Refactoring to allow pre-existing pagination

see https://github.com/nolimits4web/Swiper/issues/355