image edit function implement