BAC-1008: use $wgUploadPath

PR #2003 backported