public static string LinkContentImages(string content)
        {
            CQ document = content;

            if (!String.IsNullOrWhiteSpace(document.Render()))
            {
                var images = document.Select("img");

                images.Each((element) =>
                {             
                    CQ cqElement = new CQ(element);

                    cqElement.BuildSitefinityReference();
                });
            }

            return document.Render();
        }
        public static string LinkContentImages(string content)
        {
            CQ document = content;

            if (!String.IsNullOrWhiteSpace(document.Render()))
            {
                var images = document.Select("img");

                images.Each((element) =>
                {
                    CQ cqElement = new CQ(element);

                    cqElement.BuildSitefinityReference(LinkedImageTagType.Image);
                });

                // Repeat this process for any links that point to image
                // resources.
                var imageLinks = document.Select("a");

                imageLinks.Each((element) =>
                {
                    CQ cqElement = new CQ(element);

                    string imageSrc = cqElement.Attr("href");

                    if (imageSrc.EndsWith(".jpg") ||
                        imageSrc.EndsWith(".png") ||
                        imageSrc.EndsWith(".gif") ||
                        imageSrc.EndsWith(".tiff"))
                    {
                        cqElement.BuildSitefinityReference(LinkedImageTagType.Anchor);
                    }
                });
            }

            return document.Render();
        }