Added proper pagination to list threads page.