def default_style(piece, breakpoints)
        sizes = breakpoints[:full]

        # calculate the image size at :full breakpoint based on the piece width
        image_size = (piece.size.to_f / 12.0 * content_size(sizes, piece)).to_i

        # round up to nearest 200
        image_size = image_size.round(-2)
        image_size += 100 if (image_size / 100).odd?

        default_style = "x#{image_size}"

        piece.image.attachment.exists?(computed_style(piece, default_style.to_sym)) ? default_style : :_medium
      end
def default_style(piece, breakpoints)
        sizes = breakpoints[:full]

        # calculate the image size at :full breakpoint based on the piece width
        image_size = (piece.size.to_f / 12.0 * content_size(sizes, piece)).to_i

        # round up to nearest 200
        image_size = image_size.round(-2)
        image_size += 100 if (image_size / 100).odd?

        default_style = "x#{image_size}"

        piece.image.attachment.exists?(computed_style(piece, default_style.to_sym)) ? default_style : :_medium
      end
Figure out the default style based on the largest size at the largest
 breakpoint for browsers that don't support srcset. This is at least
 better than always serving the largest style (:x2000).