<% width = 36 if width.blank? %> <% if document.image? || document.pdf? || document.video? %> <% path = sufia.download_path(document.noid, {datastream_id: 'thumbnail'}) %> <% elsif document.audio? %> <% path = "audio.png" %> <% else %> <% path = "default.png" %> <% end %> <%= link_to image_tag(path, {width: width}), sufia.generic_file_path(document) %>