Fix imagediff.

I think the problem was, that img.src='...' does not load the image nor block till the image is loaded, which caused weird behaivior.

I think i fixed this.