Problem solved.
The galleries were placed in page by calling from another plugin, i just inserted a, invisible gallery manually on the page and the scripts worked properly.
I use foogallery and foogallery lightbox, and for some reason it doesn’t get the data-src-fg to src