$(function() {
	$.getJSON("https://mywebservice.info/beautyUniversity/data_out.php", function(data) {
		var str = "";
		for (var i = data.length - 1; i >= 0; i--) {
			if(data[i]["message"] === "" || data[i]["object_id"] === "") {
				continue;
			}

			str += "<a href='" + "https://graph.facebook.com/" + data[i]["object_id"] + "/picture?type='normal'" +"'";
			str += "<img class='shadow-img shadow-img-size' data-src='"+"https://graph.facebook.com/"+ data[i]["object_id"] + "/picture?type='thumbnail'"+ "'>";
			str += "</a>";
		}

		$(".popup-gallery").append(str);
	 });

	$(window).on('ajaxComplete', function() {
  		setTimeout(function() {
  			$(window).lazyLoadXT();
  		}, 50);
	});

	$('.popup-gallery').magnificPopup({
		delegate: 'a',
		type: 'image',
		tLoading: 'Loading image #%curr%...',
		mainClass: 'mfp-img-mobile',
		gallery: {
			enabled: true,
			navigateByImgClick: true,
			preload: [0,1] // Will preload 0 - before current, and 1 after the current image
		},
		image: {
			tError: '<a href="%url%">The image #%curr%</a> could not be loaded.',
			titleSrc: function(item) {
				return item.el.attr('title') + '<small>by Marsel Van Oosten</small>';
			}
		}
	});
});
@@ -687,14 +687,12 @@
 0);%0A
-%09%7D);%0A%0A
+%0A  %09
 %09$('
@@ -726,16 +726,17 @@
 pup(%7B%0A%09%09
+%09
 delegate
@@ -742,16 +742,17 @@
 e: 'a',%0A
+%09
 %09%09type: 
@@ -760,16 +760,17 @@
 image',%0A
+%09
 %09%09tLoadi
@@ -801,16 +801,17 @@
 r%25...',%0A
+%09
 %09%09mainCl
@@ -835,16 +835,17 @@
 ile',%0A%09%09
+%09
 gallery:
@@ -847,16 +847,17 @@
 lery: %7B%0A
+%09
 %09%09%09enabl
@@ -866,16 +866,17 @@
 : true,%0A
+%09
 %09%09%09navig
@@ -899,16 +899,17 @@
 rue,%0A%09%09%09
+%09
 preload:
@@ -987,11 +987,13 @@
 e%0A%09%09
+%09
 %7D,%0A
+%09
 %09%09im
@@ -999,16 +999,17 @@
 mage: %7B%0A
+%09
 %09%09%09tErro
@@ -1076,16 +1076,17 @@
 d.',%0A%09%09%09
+%09
 titleSrc
@@ -1100,24 +1100,25 @@
 ion(item) %7B%0A
+%09
 %09%09%09%09return i
@@ -1183,16 +1183,24 @@
 %3E';%0A
+%09
 %09%09%09%7D%0A%09%09
-%7D
+%09%7D%0A%09%09%7D);
 %0A%09%7D)

change trigger magnificPopup after ajaxComplete