As far as I know this would be unavoidable since one of the requirements for a pope is to be a valid bishop.
Not necessarily. Even if Francis isn't a valid bishop, assuming his election was valid, he'd be a papal-elect. So, in theory, the office would be filled (from a human/govt aspect) but it would be vacant (spiritually) until he were made a bishop and accepted properly.
There were examples in history where young men were appointed bishops of their diocese, and they weren't even priests. So, in theory, this could happen to a pope.
To Matthew's point, the papacy is a mystery. The idea that a man can be the "Vicar of Christ" and "infallible" is nothing short of a heavenly miracle. Only God knows the limits of what He will allow and won't - and every crisis in Church history always proves this. Once the dust settles and calm returns to the Church, we'll say (just like many people before us have said),
"Well, I didn't think God would allow that to happen, but He did. And I didn't think He would settle that problem so quickly and definitively, but He did. And I see now the benefit to the Church, in having gone through all of that, for now doctrine x, y or z is more fully understood and appreciated. Blessed be God!"