A single unit of any size can move through a gateway in its Movement phase with no reduction to its movement. The unit doesn't need to change formation as it is presumed that it pours through the gate and reforms on the other side.
It is not uncommon for the front of a unit to end up on one side of the gate and the back of the unit to be on the other. This is fine. Place the part of the unit that has passed through the gate on the far side and leave the part that is still to pass through on the other. As long as the ranks on both sides are in contact with the gate, this is perfectly acceptable. Depending upon the size of the gate, some larger models, such as Giants and Dragons, may be too large to pass through the gate so they will obviously not be able to get into the fortress that way!