added img diff logic