Solved! In this case Infoboxes are the key to linking a click to a marker. So given that var ib = new InfoBox();
Then, inside a function that attaches infoboxes to the markers I add a new property 'num' to the 'ib' object and define it by each markers 'i' variable. ib.num = i;
Then I can use it inside the magnificPopup function to call for the triggered marker's values I have stored in an array. markerData[ib.num][7]
The new script:
window.google.maps.event.addListener(ib, "domready", function () {
$('.open-popup-photo').on('click', function () {
$.magnificPopup.open({
items: {
src: markerData[ib.num][7]
},
type: 'image' // this is default type
});
});
});