Add onerror handling for img/video loading.

src being null or undefined should probably throw an exception or similar.