Sorry for keep you waiting, but your ticket (and modifications) are very custom. This kind of modifications are usually out of scope of our support.
However, I will be here to assist you with this. Could you please try renaming class ‘.gallery’ in the 3rd ant 10th lines of code of /js/jquery.magnific-popup-init.js.
It should disable lightbox for galleries.