% if object.present? && object.asset.present? %>
<% max_img_size = object.max_image_size %>
<% if object.background_image? %>
<% else %>
<% if object.disallow_resize? %>
<% img_path = object.asset.image.url %>
<% else %>
<% img_path = object.asset.image.url(max_img_size, max_img_size, quality: 65) %>
<% end %>
<% if object.url.present? %>
<%= link_to object.url, target: object.target do %>
<%= image_tag img_path, alt: '', class: 'img-fluid' %>
<% end %>
<% else %>
<%= image_tag img_path, alt: '', class: 'img-fluid' %>
<% end %>
<% if object.caption.present? %>
<% if Udongo.config.flexible_content.picture_caption_editor? %>
<%= object.caption.html_safe %>
<% else %>
<%= object.caption %>
<% end %>
<% end %>
<% end %>
<% end %>