public void getSize(string uriString, IPromise promise)
        {
            if (string.IsNullOrEmpty(uriString))
            {
                promise.Reject(ErrorInvalidUri, "Cannot get the size of an image for an empty URI.");
                return;
            }

            DispatcherHelpers.RunOnDispatcher(async () =>
            {
                try
                {
                    var bitmapImage = new BitmapImage();
                    var loadQuery = bitmapImage.GetStreamLoadObservable()
                        .Where(status => status.LoadStatus == ImageLoadStatus.OnLoadEnd)
                        .FirstAsync()
                        .Replay(1);

                    using (loadQuery.Connect())
                    {
                        using (var stream = await BitmapImageHelpers.GetStreamAsync(uriString))
                        {
                            await bitmapImage.SetSourceAsync(stream);
                        }

                        await loadQuery;

                        promise.Resolve(new JObject
                        {
                            { "width", bitmapImage.PixelWidth },
                            { "height", bitmapImage.PixelHeight },
                        });
                    }
                }
                catch (Exception ex)
                {
                    promise.Reject(ErrorGetSizeFailure, ex.Message);
                }
            });
        }