If the electoral college can’t certify, and the court can’t resolve it because they don’t know how to remedy fraud, constitutionally, it goes to the House for a majority vote, but it’s by state delegation. That is, each state gets one vote. If, for whatever reason, the House can’t come to a decision and vote by January 20, then I believe the speaker of the new House session is sworn in - which in this case would be Pelosi.
Also, if the electoral college meets and votes and someone gets to 270, then the House can either choose to accept it, or it can be contested there. And from there it can refuse to certify and hold a vote.
My opinion, though, is that if the electoral college can come to a decision, then the House will certify it and move forward. The sum of all fears (for everyone) would be a Pelosi presidency.
I think this is the procedure - but I could be wrong.