Save file in same location as input-file in Shortcuts

I am trying out Shortcuts in Monterey.
And it is a simple shortcut, which takes image-files as input and converts them to pdf.

But I have some difficulty to make sure the pdf is saved in the same location as the input image.

I do not know if screenshots help, since I am on a danish system.

But if someone has some input in how to do this?

I tried using the path from the input as a variable in the save action, but I did not get it to work.