Exactly, that’s spot on! The change in the shape of the trail is related to how air density drops with altitude. The higher it goes, the lower the pressure — so the exhaust gases expand much more. You can actually see this effect in many rocket launches, even the big space ones.