= form.inputs :name => record.class.human_attribute_name(field) do
  - if image_url = record.send("#{field}_import_url") || (record.send(field).file? && record.send(field).url(:medium))
    %li
      = image_tag image_url, :size => '220'

  = form.input "#{field}_import_url".to_sym, :label => "Import a #{record.class.human_attribute_name(field)} from a URL…"
  = form.input "#{field}".to_sym, :label => "…or upload one from your computer.", :hint => "Preferably 220px wide or larger"

-# Display the form fields for adding or importing a photo, and display a photo if associated.
-#
-# ARGUMENTS:
-# * form: The Rails HTML form instance.
-# * record: The ActiveRecord model instance.
-# * field: The String or Symbol name of the field containing the image, e.g. :logo.
= form.inputs :name => record.class.human_attribute_name(field) do
  - if image_url = record.send("#{field}_import_url").presence || (record.send(field).file? && record.send(field).url(:medium))
    %li
      = image_tag image_url, :size => '220'

  = form.input "#{field}_import_url".to_sym, :label => "Import a #{record.class.human_attribute_name(field)} from a URL…"
  = form.input "#{field}".to_sym, :label => "…or upload one from your computer.", :hint => "Preferably 220px wide or larger"

Fix image import form partial to only display imported image if it exists.
Fix image import form partial to only display imported image if it exists.
