content: get_prev_next_contents fixed

Fixes #365.