private static System.Drawing.Image convertFromMemory(IntPtr thumbData)
{
propertyItemInternal prop =
(propertyItemInternal)Marshal.PtrToStructure
(thumbData, typeof(propertyItemInternal));
// The image data is in the form of a byte array. Write all
// the bytes to a stream and create a new image from that stream
byte[] imageBytes = prop.Value;
MemoryStream stream = new MemoryStream(imageBytes.Length);
stream.Write(imageBytes, 0, imageBytes.Length);
return System.Drawing.Image.FromStream(stream);
}