Correct use of s3_resource with a caching policy

This makes sure we're using the correct variable of `s3_resource` if you have a caching policy in place. The previous variable of `file` doesn't exist anymore due to the recent re-factor.