Image update logic added