here is what i do, when if the image is not present in database i want to show a sample image,named "unknownUser" in my resources.
Private Sub DataGridView1_DataError(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewDataErrorEventArgs) Handles DataGridView1.DataError
If e.ColumnIndex = 1 Then
Dim cell As DataGridViewImageCell = DataGridView1.Rows(e.RowIndex).Cells(1)
cell.Value = My.Resources.UnknownUser
End If
End Sub
so if you use this, there wont be any error "X" image in your grid, and your code wont throw any exception at all.