if(coords.w > coords.h) {
      aspect_ratio = coords.h / coords.w
      preview.width(100)
      preview.height(100 * aspect_ratio)
    } else {