This JavaScript code will trigger an event when an image is completely loaded. You need to have the jQuery Library.
JavaScript code:
var img = new Image();
$(img).load(function(){
$(imageContainer).html(this); // Add the image in the document.
// Add any event …
}).error(function(){
// No image event …
}).attr("src", imagePath);