def scale_image(image, new_width=600):
    """
    scales the image to new_width while maintaining aspect ratio
    """
    new_w = new_width
    (old_w, old_h) = image.size
    aspect_ratio = float(old_h)/float(old_w)
    new_h = int(aspect_ratio * new_w)
    new_dim = (new_w, new_h)
    image = image.resize(new_dim)
    return image