fix(pagination): Ajax array decreased update

Fix to update ajax array and update number of items if the array has decreased in size.