fix lightbox code for static and Contao 3.1 compatibility