Sort pages in ascending order
Fix bug where page `data-offset` gets outdated on resize