code cleanup and fixing lightbox