Pick initial scale based on min(width, height)
Previously we always used the window width, which can result in parts of the cave being outside the initial view. Reported by Wookey.