Adds pagination to topics page