Is there a way to trigger an event when an image has finished loading?