Public Shared Function CleanPhoto(ByVal SourcePhoto As Byte()) As Byte()
'Declare variables
Dim PhotoString As String = System.Convert.ToBase64String(SourcePhoto)
Dim RetVal As Byte()
'Calculate and remove OLE headers if present
If (PhotoString.Substring(0, 10) = "FRwvAAIAAA") Then
RetVal = System.Convert.FromBase64String(Mid(PhotoString, 105))
Else
RetVal = SourcePhoto
End If
Return RetVal
End Function