title: How to add subtext to images in sitefinity gallery?
body: <p>I need to add subtext to each image in sitefinity gallery. I've tried putting each image inside a div and group it that way but that messed up gallery formatting completely. I've also tried using spans and with that I only managed to position the text using not so responsive css. </p>
  
  <pre><code>@for (int i = 0; i &lt; Model.Items.Count(); i++)
  {
      var item = Model.Items.ElementAt(i);
      var thumbnailViewModel = (ThumbnailViewModel)item;
  
      var itemIndex = (Model.CurrentPage - 1) * ViewBag.ItemsPerPage + i + 1;
      var detailPageUrl = ViewBag.OpenInSamePage ? HyperLinkHelpers.GetDetailPageUrl(item, ViewBag.DetailsPageId, ViewBag.OpenInSamePage, Model.UrlKeyPrefix, itemIndex) :
          HyperLinkHelpers.GetDetailPageUrl(item, ViewBag.DetailsPageId, ViewBag.OpenInSamePage, Model.UrlKeyPrefix);
  
      &lt;a class="text-center"
         href="@detailPageUrl"
         title="@(string.IsNullOrEmpty(item.Fields.Description) ? item.Fields.Title : item.Fields.Description)"&gt;
  
          &lt;img class="gallery_images" src="@(thumbnailViewModel.ThumbnailUrl)" alt='@System.Text.RegularExpressions.Regex.Replace(item.Fields.AlternativeText, @"[^\w\d_-]", "")'
               @Html.GetWidthAttributeIfExists(thumbnailViewModel.Width)
               @Html.GetHeightAttributeIfExists(thumbnailViewModel.Height) /&gt;
  
  
      &lt;/a&gt;
  
    }
  </code></pre>
  
  <p>this is the code that actually populates the gallery. how do I add subtext to each image and keep it actually under the image and with the image?
  This is what each image should look like: <a href="https://i.imgur.com/42pqS0L.png" rel="nofollow noreferrer">https://i.imgur.com/42pqS0L.png</a></p>