added more support for python image upload