Fix image size calculation problem, move it from document.ready to window.load.