Many thanks @kosiew for your suggestions.
In the end, and somewhat frustratingly since I’ll never know why this happened, deleting the images from my library and re-uploading them was enough for wordpress to start displaying them properly again.
But doing the conflict testing was useful anyway because after doing it, I tried just displaying other images from my image library, which did in fact display properly. Should have thought of doing this earlier!
Btw, as an fyi regarding using storefront for testing, since the website uses Divi, this doesn’t seem to help because I just ended up seeing all the Divi shortcode after switching themes.