[BUGFIX] Filter by active content elements first before deduplicating references (thanks to @hackerman26)
This fixes a bug where the image credits for an image would not show up if there were two content elements on a page referencing the same image and the first content element being disabled.