When an example fails. It gets the broken image assigned which is then captured for the thumbnails gallery.
If I rerun the build, Sphinx-gallery does not run the example again, as it has a first image associated and the source code has not changed. But I believe it should try again. If the example failed due to missing dependencies, or similar. The problem is to be fixed outside the codebase, and when fixed and the gallery is rerun it should try again with the example.
If the example code was bad, changing it will always trigger Sphinx-Gallery to build it again.