Fixed links in galleries and loading of posts with many pages

Closes #11