Improve default pagination template

Improved with this snippet, avoiding layout breaking when have many pages.
https://gist.github.com/raelmax/1090095