Lightbox: Fixed handling of same-page links to elsewhere on the page

Fixes #5767
Merge pull request #5777 from pjackson28/samepagelinkhandlerlbox

Lightbox: Fixed handling of same-page links to elsewhere on the page