Made postsPerPage configurable and fixed previousURL calculation

The previousURL link would not have appeared if you would had 3 blog posts and used postsPerPage=2