Fix malformed keys when using fog with endpoint

If fog config options include an endpoint, keys generated for previously created uploads end up having bucket name duplicated in the URL. This results in not found errors after successful uploads.