Get documents directory in Swift via Extension

I'm new to Swift and trying to render an image in one of my views, however I'm unable to get a valid path to the image.

I store my images in the Documents directory from my app: e.g. file:///var/mobile/Containers/Data/Application/C3393739-E00D-4172-B098-086DE8669804/Documents/ImagePicker/93295063-F43C-4CCD-A01B-1BA3B6E61CAB.jpg. This image is stored via a React Native image picker.

Since the absolute path changes on every build, I'm using the FileManager.default.urls(for: .documentDirectory, in: .userDomainMask) method to get the path to the Documents directory.

But this returns an invalid path. It's called from an extension (see Access app Documents folder from Today Extension). I expect a path similar to my image, but I get one that looks like this: file:///var/mobile/Containers/Data/PluginKitPlugin/13B94BC7-01E5-43E4-A05A-247BA399D922/Documents/ImagePicker/2174E762-B850-434E-82B4-9A5703FE5EF7.jpg

How can I access the right documents folder?