Fix bug in lightbox with customClass

There was a bug when two lightbox are opened with different classes.