Detect image change more reliably.
Remove debugging code.