Updated Image comparision code