added the img function