refactor lightbox navigation to preserve scroll (bug 979506)

https://bugzilla.mozilla.org/show_bug.cgi?id=979506

Fixes a bug that caused the page to scroll to top after closing the lightbox.