Allow defining upload_dir/upload_url for each image version. Closes #2340.
Merge branch 'master' into gh-pages