How can I check if a all images in gallery is loaded?

How can I check if a all images in gallery is loaded?

How can I check if a all images in gallery is loaded? 

when all images are loaded fully then only starts sliding of the gallery.

plz suggets.

$(function () {
$("img").load(function(){
  alert("Image loaded.");

$('#main-photo-slider').codaSlider({
autoSlide: true,
autoHeight: false
});
$navthumb = $(".nav-thumb");
$crosslink = $(".cross-link");
$navthumb
.click(function () {
var $this = $(this);
theInterval($this.parent().attr('href').slice(1) - 1);
return false;
});














theInterval();
});

});

its not working