Fix bug in upload_image for py3.3 see #211