Add onerror handling for img/video loading.

This looks wrong -- it's resetting the onerror attribute (though that doesn't look correct for Firefox).