Allow defining upload_dir/upload_url for each image version. Closes #2340.