Yeah, the Image Filtering was the problem.
I managed to fix the code by adding a few lines.
Change this:
if ((isNsfw && unveilNsfw) || (isSpoiler && unveilSpoilers)) {
this.src = this.getAttribute('data-original-image-url');
this.height = this.getAttribute('data-original-height');
} else {
this.src = this.getAttribute('data-src')
}
to this:
if ((isNsfw && unveilNsfw) || (isSpoiler && unveilSpoilers)) {
this.src = this.getAttribute('data-original-image-url');
this.height = this.getAttribute('data-original-height');
} else if (this.hasAttribute('data-src')) {
this.src = this.getAttribute('data-src');
} else {
this.src = this.getAttribute('src')
}
Probably there is a better way to fix it, but the filtering seems to be working and the other images are loading, so good enough for me.