project: Check path extension first, then worktree's (#29671)

This fixes a bug with opening images on worktrees that contain
"extension" in the dir name, like `zed.dev`


Release Notes:

- N/A
632f08d2a3Oleksiy Syvokon committed on 4/30/2025, 3:01:52 PM· committed by GitHubparent5589e78
1 file changedLine totals unavailable