Fix null error in lightbox plugin when element is deleted.
Merge pull request #5793 from andre-d/undeffix

Fix null error in lightbox plugin when element is deleted.