Fixed API version.
Some refactoring on image upload.