Fixes issue #235 by adding an onerror function

This could also help by allowing other image hosting site
extensions to leverage the onerror function