public object ConvertToLocalImageSource(byte[] data, int width, int height)
        {
            if (data == null)
                return null;

            try
            {
                var bitmap = new WriteableBitmap(width, height);
                bitmap.FromByteArray(data);

                return bitmap;
            }
            catch
            {
                return null;
            }
        }