Remove incorrect calls to window.innerWidth; reordered declaration of pager_position.