Adding pagination for index and topic pages