Much like how the video tag can provide multiple source attributes so an mp4 video can fall back to an ogg video, I would like to get an svg image to fall back to an png image.
There's a post here that might help: Fallback image and timeout - External Content. Javascript
It offers a few javascript options.
Using a background image works well, but you will have to know what the dimensions of your images are. If you don't know then it may be tricky.