Merge pull request #12435 from Filoppi/fix-aspect-ratio-stuck Fix aspect ratio heuristics getting stuck to a state