Improve pagination with jquery