Hg 89 add media to lightbox

Mkay,
I would like to merge it.
Any additional work apart from fixing this, will be handled outside this PR.
break this function out. too much nesting and 4 returns in one function, much less an init function