Fix aspect ratio computation.

It cannot happen in legacy_params() as at this point the size of the
image is not yet known. We then use a deferred circuitry to handle
this at the right point in the code.

Fixes #9320.