diff --git a/app/views/attachments/_links.html.erb b/app/views/attachments/_links.html.erb
index e39eb50..24ff3f9 100644
--- a/app/views/attachments/_links.html.erb
+++ b/app/views/attachments/_links.html.erb
@@ -59,30 +59,34 @@
<% end %>
-<% if defined?(thumbnails) && thumbnails %>
- <% images = attachments.select(&:thumbnailable?) %>
- <% if images.any? %>
-
- <% images.each do |attachment| %>
-
- <%=
- link_to image_tag(url_for(:controller => 'attachments', :action => 'thumbnail', :id => attachment)),
- {:controller => 'attachments', :action => 'download', :id => attachment, :filename => attachment.filename},
- :class => ('lightbox' + (attachment.is_pdf? ? ' pdf' : '')) , :rel => 'thumbnails', :title => "#{attachment.filename}#{ ('-' + attachment.description) unless attachment.description.blank? }"
- %>
-
+
+<% if defined?(Setting.thumbnails_enabled) && Setting.thumbnails_enabled? %>
+ <% if defined?(thumbnails) && thumbnails %>
+ <% images = attachments.select(&:thumbnailable?) %>
+ <% if images.any? %>
+
+ <% images.each do |attachment| %>
+
+ <%=
+ link_to image_tag(url_for(:controller => 'attachments', :action => 'thumbnail', :id => attachment)),
+ {:controller => 'attachments', :action => 'download', :id => attachment, :filename => attachment.filename},
+ :class => ('lightbox' + (attachment.is_pdf? ? ' pdf' : '')) , :rel => 'thumbnails', :title => "#{attachment.filename}#{ ('-' + attachment.description) unless attachment.description.blank? }"
+ %>
+
+ <% end %>
+
<% end %>
-
+ <% else %>
+ <% images = attachments.select { |a| a.image? } %>
+ <% unless images.empty? %>
+
+ <% images.each do |attachment| %>
+ <%= link_to image_tag(url_for({:controller => 'attachments', :action => 'download', :id => attachment, :filename => attachment.filename }), :width => Setting.thumbnails_size),
+ {:controller => 'attachments', :action => 'download', :id => attachment, :filename => attachment.filename }, :class => 'lightbox', :rel => 'thumbnails', :title => "#{attachment.filename}#{ ('-' + attachment.description) unless attachment.description.blank? }" %>
+ <% end -%>
+
+ <% end -%>
<% end %>
-<% else %>
- <% images = attachments.select { |a| a.image? } %>
- <% unless images.empty? %>
-
- <% images.each do |attachment| %>
- <%= link_to image_tag(url_for({:controller => 'attachments', :action => 'download', :id => attachment, :filename => attachment.filename }), :width => '180'),
- {:controller => 'attachments', :action => 'download', :id => attachment, :filename => attachment.filename }, :class => 'lightbox', :rel => 'thumbnails', :title => "#{attachment.filename}#{ ('-' + attachment.description) unless attachment.description.blank? }" %>
- <% end -%>
-
- <% end -%>
<% end %>
+