refactor(pagination): change the way `num-pages` is assigned

Closes #976