Don't show next/previous block links if there isn't a next/previous block

The empty divs are still output to the page to stop the layout breaking.