modified pagination based on window width