Open PhotoPicker from a popover button on MacOS

SwiftUI's PhotoPicker doesn't fit into the screen when I place it on a popover and click on it to select a photo.

The relevant code I use:

.popover(
    isPresented: $showAttachments
) {
    VStack(alignment: .leading, spacing: 20) {
        // ...

        PhotosPicker(selection: $photos) {
            HStack {
                Image(systemName: "photo")
                Text("Media")
            }
        }
    }
}

It seems like the photo picker is positioned relative to the popover position and I can't find any configuration options regarding to its' positioning.

How to position the PhotoPicker correctly?