I'm trying to port the old HTML.Image helper, that I'm sure everyone has used at one point or another, and I'm having issues. The following compiles fine:

```
@Html.Image("my-id", "~/Content/my-img.png", "Alt Text")

```

But when I try to use it in a view it simply writes:

```
<img alt="Alt Text" id="my-id" src="/content/my-img.png" />

```

And doesn't display the image. Can anyone assist?

Here's the HTML.Image helper code that I'm using:

```
public static class ImageHelper
{
    public static string Image(this HtmlHelper helper, string id, string url, string alternateText)
    {
        return Image(helper, id, url, alternateText, null);
    }

    public static string Image(this HtmlHelper helper, string id, string url, string alternateText, object htmlAttributes)
    {
        // Instantiate a UrlHelper 
        var urlHelper = new UrlHelper(helper.ViewContext.RequestContext);

        // Create tag builder
        var builder = new TagBuilder("img");

        // Create valid id
        builder.GenerateId(id);

        // Add attributes
        builder.MergeAttribute("src", urlHelper.Content(url));
        builder.MergeAttribute("alt", alternateText);
        builder.MergeAttributes(new RouteValueDictionary(htmlAttributes));

        // Render tag
        var ret = new MvcHtmlString(builder.ToString(TagRenderMode.SelfClosing));
        return ret.ToHtmlString();
    }

}

```