I'm having a little trouble with clipping that I hope someone can help me with.
I'm starting with a SVG flag and a square. The goal is to get the flag inside the square and keep the stroke border around the edge, like so:

Right now I make two copies of the square, put one on top of the flag and set the clipping. The problem is, that sometimes inkscape still registers the size of this object as the size of the flag. That makes aligning it with the top square to complete the border must be done manually.
The bigger problem is, even if I manually align the flag with the border and group them as one object, inkscape doesn't recognize the correct size of the object as shown in the screenshot. Since I'll eventually have to align hundreds of these flags, doing it manually is not an option.

Does anyone have a better suggestion for how I should do this?
Thanks in advance for any help,
-Grey