Alright, the title is a bit misleading.

So I have a program that allows the user to load up some images, which appear in a ListBox. You can click the imported images and they load into a PictureBox.

Here's the code:

vb.net Code:
  1. Public Class Form1
  2.  
  3.     Private Sub import_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles import.Click
  4.         Dim result As DialogResult = openfile.ShowDialog
  5.         Images.Items.Add(openfile.FileName)
  6.         Images.SelectedIndex = 0
  7.         PictureBox1.Image = Image.FromFile(Images.Text)
  8.     End Sub
  9.  
  10.     Private Sub Images_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Images.SelectedIndexChanged
  11.         PictureBox1.Image = Image.FromFile(Images.Text)
  12.     End Sub
  13.  
  14.     Private Sub delete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles delete.Click
  15.         Images.Items.Remove(Images.SelectedItem)
  16.     End Sub
  17. End Class

Now here is my problem: when the user tries to delete a image, an exception occurs like this:

Code:
System.ArgumentException was unhandled
 The path is not of a legal form.
You can load up the code and see for yourself. Now I need to be able to delete these images from the ListBox. The exception occurs because the image is now null, and can't load.

Any ideas?