I am trying to achieve an old filmstrip shape (see image). I would like to be flexible in the amount of images, so I thought the best solution is to do only something with the right side, so the length of the filmstrip doesn't matter.
What is a good way to achieve this?
So the right part is always snapping to the right side of the filmstrip. I can make to parts, where the left part containing the image, and the right part the lower part. But then I don't have the round corners and also what I want is the border that follows the shape, because it will help the filmstrip to separate from the background.

There's a few approaches to this, but one would be to build the shape out of its composite pieces rather than trying to impose the full shape on it afterward. This way, you can add and remove items freely to the container and it will keep that same outer shape since it's only being dictated by the CSS applied to the last item.
You can apply a corner-cut styling to the last item in that sequence, and then follow it up with a smaller partially rounded rectangle to the right. This gets you part of the way there, it'd need some tweaking to look exactly the way that you want.