Event if an image is loaded or not with jquery