It can't be assumed the array passed to setModIcons is still correct in the async image callbacks. Instead, fetch the current modicons array in the callback and use that.