Revert "Revert "Fix #795: Close lightbox only if buttons, ESC key or the X icon is pressed""

This reverts commit a367787f26d2fd152b28fd2934dd1950bb2ca4eb.