im = Image.open(img)
im2 = im.resize((500, 100), Image.NEAREST)
out_im2 = cStringIO.StringIO()
im2.save(out_im2, 'PNG')
conn = boto.connect_s3()
b = conn.get_bucket('example')
k = b.new_key('example.png')
k.set_contents_from_string(out_im2.getvalue())
Upload resized image to S3