BACKLOG-4066: Fix previous/next link when reaching pagination lower/upper bound