Fixed the pagination to make it work better on smaller devices.