modify pagination for mobile devices