Blueimp rails gallery

I’m using this image gallery for a rails project. It’s working ok, but I have an issue with it. I’ve got links to remove the images on the show page, but when I click on to start the gallery slideshow these links are apart of the slideshow (and display no image). I’m not sure what I can do to exclude them from the slideshow.

Any suggestions? Thanks, Joe

<div id="links">

     <% @discrepancy.images.each do |image| %>

                    <%= link_to 'Remove', delete_an_image_url(attachment_id:, discrepancy_id:,
                        method: :delete,data: { confirm: 'Are you sure?' } %>

                     <a href="<%= rails_blob_path(image) %>" > 
                          <img src="<%= rails_blob_path(image) %>"   alt="<%= image.filename %>" width="250" height="250" /> 
      <% end %>


<% content_for :page_scripts do %>

  <script type="text/javascript">

   document.getElementById('links').onclick = function (event) {
  event = event || window.event;
  var target = || event.srcElement,
    link = target.src ? target.parentNode : target,
    options = {index: link, event: event},
    links = this.getElementsByTagName('a');
  blueimp.Gallery(links, options);


ok , I solved it.

no worries.