Comment convertir Byte [] en BitmapImage

J'ai besoin d'aide, j'ai cette méthode pour obtenir un BitmapImage à partir d'un Byte[]

public BitmapSource ByteToBitmapSource(byte[] image)
{
    BitmapImage imageSource = new BitmapImage();

    using (MemoryStream stream = new MemoryStream(image))
    {
        stream.Seek(0, SeekOrigin.Begin);
        imageSource.BeginInit();
        imageSource.StreamSource = stream;
        imageSource.CacheOption = BitmapCacheOption.OnLoad;
        imageSource.EndInit();
    }

    return imageSource;
}

imageSource.EndInit(); renvoie une erreur "Nous n'avons trouvé aucune composante d'imagerie approprié pour effectuer cette opération."

source d'informationauteur fma3