def harvest_image_data(image)
      response = Typhoeus.get(image.large_url(false), followlocation: true)

      if response.success?
        raise "Invalid content type: " + response.headers['Content-Type'] unless (response.headers['Content-Type'] == 'image/jpeg')
      elsif response.timed_out?
        raise "Request timed out"
      elsif response.code == 0
        raise "Could not get an HTTP response"
      else
        raise "HTTP request failed: " + response.code.to_s
      end

      response.body
    end
def harvest_image_data(image)
      response = Typhoeus.get(image.large_url(false), followlocation: true)

      if response.success?
        raise "Invalid content type: " + response.headers['Content-Type'] unless (response.headers['Content-Type'] == 'image/jpeg')
      elsif response.timed_out?
        raise "Request timed out"
      elsif response.code == 0
        raise "Could not get an HTTP response"
      else
        raise "HTTP request failed: " + response.code.to_s
      end

      response.body
    end
Retrieve the binary image data for a given Image object

 @param [Image] image An Image model object from the Instagram service

 @raise [Exception] If there are request problems

 @return [String] Binary image data