Help Fixing Unloadable Images

How can I replace a post image that has a link that no longer exists with a default post image?

A manual solution is not an option due to our volume of posts.

I have tried various vanilla JS and jQuery solutions on StackOverflow, nothing seems to work. (Should’ve known to turn here first, lol). I have a feeling someone has conquered this already and can help me stick to a solution using Ghost helpers.

** Obviously looking for something light on computation to not affect load times

Thanks in advance!

Do you know the post url and the new image for each one? If so, I think the easiest way would be to use the Admin API to update the feature image