update img function done.