Hmm can't you check server side if the image exist?
Alsoo plugin[...].loaded is set to true once its loaded. I reckon an invalid image would not be loaded. but I would make sure the plugin is not loading at that time
Hi, it seems, that this check doesn't work with dynamically added plugins