Fix event target for Firefox.

This commit fixes a crucial bug in Firefox that was preventing the
proper loading of images.