Detach image with VB.Net

Hi,

I want to detach all images in a serie of DraftSight drawings automatically. I can get the images, but how can i detach them? According to the help it's possible with 

DetachReferenceImage Method (ISketchManager)

I tried Unload but that doesn't detach so I'm stuck with the following code:

'Get all immediate child references of the active document
dsDoc.GetImmediateChildReferences(extDefTypeArray, extDefArray)
Dim objecttype As dsObjectType_e
Dim objectdefinition As Object
Dim i As Integer

For i = 0 To UBound(extDefTypeArray)
objecttype = extDefTypeArray(i)
objectdefinition = extDefArray(i)

If (objecttype = dsObjectType_e.dsImageDefinitionType) Then
dsImageDefinition = objectdefinition

dsImageDefinition.Unload()
debug.print ("Path: " & dsImageDefinition.GetPath())
debug.print("Found In Path: " & dsImageDefinition.GetFoundInPath())
ElseIf (objecttype = dsObjectType_e.dsPdfDefinitionType) Then
dsPdfDefinition = objectdefinition
'commandline.PrintLine("Path: " & dsPdfDefinition.GetPath())
'commandline.PrintLine("Found In Path: " & dsPdfDefinition.GetFoundInPath())
ElseIf (objecttype = dsObjectType_e.dsDgnDefinitionType) Then
dsDgnDefinition = objectdefinition
' commandline.PrintLine("Path: " & dsDgnDefinition.GetPath())
'commandline.PrintLine("Found In Path: " & dsDgnDefinition.GetFoundInPath())

End If

Next