Added image insert function