private static MediaFile GetMediaFile(IUmbracoMapper mapper, IPublishedContent publishedMediaItem)
        {
            if (publishedMediaItem == null)
            {
                return null;
            }

            var mediaFile = new MediaFile();
            mapper.Map(publishedMediaItem, mediaFile);
            return mediaFile;
        }
        /// <summary>
        /// Helper to convert an IPublishedContent media item into a MediaFile object
        /// </summary>
        /// <param name="media">Selected media</param>
        /// <param name="rootUrl">Root Url for mapping full path to media</param>
        /// <returns>MediaFile instance</returns>
        private static MediaFile GetMediaFile(IPublishedContent media, string rootUrl)
        {
            var mediaFile = new MediaFile
            {
                Id = media.Id,
                Name = media.Name,
                Url = media.Url,
                DomainWithUrl = rootUrl + media.Url,
                DocumentTypeAlias = media.DocumentTypeAlias,
                Width = media.GetPropertyValue<int>("umbracoWidth"),
                Height = media.GetPropertyValue<int>("umbracoHeight"),
                Size = media.GetPropertyValue<int>("umbracoBytes"),
                FileExtension = media.GetPropertyValue<string>("umbracoExtension"),
                AltText = media.GetPropertyValue<string>("altText")
            };

            return mediaFile;
        }