imageError can still be triggered even if the image load has been cancelled under js.

This check ensures we ignore it if content has been set to null, which happens when cancel is called.