Dynamic component copies scaling differently

I have made a sliding door Dynamic component that I want to have options for height, width and number of panels.
The functions are working but the panels seem to scale randomly when I opt for 3 or more panels. The scale of the panels just doesn’t seem to be consistent.
Is there a way to make the panels scale consistently with the overall frame?
SLIDING DOOR.skp (85.1 KB)

need to fix the lenx of the panel bottom, top
check formula

SLIDING DOOR.skp (190.4 KB)

Great! thank you