[Bug]: Editor with pages , when synced with store and ydoc , on refresh show error trying to access pageId that not found in the pages.
### What happened?

When i sync data with y doc and store pages , i need to when refresh return to the last page i was in , but i found error : that tried to access pageId that not found in the pages 
and i think the bug because editor trying to setcurrentpageId before pages come from y doc 
and that's occur with TldrawImage also , as the component use setCurrentPageId inside it and the pages wasn't come yet.

### How can we reproduce the bug?

_No response_

### What browsers are you seeing the problem on?

Chrome

### Where did this happen?

The developer package

### Contact Details

youssef7amdi@gmail.com

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct