Adapt pagination to the UI