Fixes pagination link URLs

Links were generating an error, this creates variables to hold the
next/prev link values.