You will not be able to create an image of an icon this way. You will have to use the Icon class, an Image is not an Icon.
Code:
'//you can use an array of valid extensions to determine which files
'//actually go through to where you try and create an image from it
'//this is probably more suited as a class level variable, i've declared
'//it locally here but you should move it out
Dim validExtensions = New String() {"tiff", "bmp", "png", "jpg", "jpeg"}
For Each F As String In System.IO.Directory.GetFiles(fbd.SelectedPath)
Dim extension = IO.Path.GetExtension(F)
'//call ToLower because we don't want case sensitivity
If Array.IndexOf(validExtensions, extension.ToLower()) > -1 Then
'//valid extension
Try
'//nest the Try inside the For loop, this will cause any problems
'//to be handled in the Catch block, and the next file to be processed
Dim NewImage As Image = Image.FromFile(F)
NewImage = NewImage.GetThumbnailImage(NewImage.Width * 0.5, NewImage.Height * 0.5, _
AddressOf abort, System.IntPtr.Zero)
Dim P As New PictureBox
P.SizeMode = PictureBoxSizeMode.AutoSize
P.Image = NewImage
P.Tag = F
AddHandler P.Click, AddressOf PictureBox_Click
FlowLayoutPanel1.Controls.Add(P)
ListBox1.Items.Add(System.IO.Path.GetFileName(F))
Catch ex As OutOfMemoryException
'//invalid file here, deal with the exception
End Try
End If
Next