<% if @design %>
  <% section = @design.sections.find_by_name( @option[:section_name] ) %>
  <% if section and section.image.url %>
    <% full_url = "#{request.script_name}#{section.image.url}" %>
    <%= image_tag full_url, style: 'max-width:100%' %>
  <% end %>
<% end %>

<% @design = @sheet.design if not @design and (@sheet and @sheet.design) %>

<% if @design %>
  <% section = @design.sections.find_by_name( @option[:section_name] ) %>
  <% if section and section.image.url %>
    <% full_url = "#{request.script_name}#{section.image.url}" %>
    <%= image_tag full_url, style: 'max-width:100%' %>
  <% end %>
<% end %>

Use the sheet design if the design isn't specified
Use the sheet design if the design isn't specified
