Fix onLoad and onError on images

Fixes bug introduced in c62c2c5.

Test Plan: Tested that the onLoad event was properly triggered on an image. Didn't test onError but I can only assume that it works equally well.