LPS-32658 Fix pagination in Documents and Media

Hey Brian,

This pull fixes some pagination issues in DocLib although this can be reproduced all over the portal in all the portlets.
We just wanted to start with this first to see if you like the idea about how to fix it and then, once we have the pattern and the fix, we will apply it everywhere else. 

Thanks!