Updated renderPagination function to the new one that is used in Barossas and M2r