Switching from Osaka to Kyoto is a minor amount of cost, so I would not bother activating a pass for a fare of 570 yen (estimated from Osaka Station to Kyoto Station). If you have extra days, then use a pass to cover the cost between Osaka and Kyoto.
If you are going to Hiroshima AND Onomichi, why are you returning back to Kyoto?
From the inclusion of both Onomichi and Imabari, I am assuming that you are planning to rent a bicycle and do the Shimanami Kaido. Here is the link:
https://www.japan-guide.com/e/e3478.htmlIf you examine the link, you will find that there is a bus that goes back to the other side for 2300 yen. You could cycle one way, and use the bus on the other direction.
You might be able to use the JR Kansai Hiroshima Area Pass at the beginning (5 days), and complete the travel to Kanazawa with a second JR Hokuriku Area Pass:
https://www.japan-guide.com/e/e2361_kansai_hiroshima.htmlhttps://www.japan-guide.com/e/e2361_hokuriku.htmlThe two passes include Tsuruga Station, so if both area active, you should be able to switch coverage at that station. The Hokuriku pass also covers busses to Shirakawa-go if you are going there. There is an additional benefit if the Hokuriku pass starts on the final day of the Hiroshima pass, in that you have eight days of coverage, instead of the seven days on the other JR pass. If you stay in Tsuruga on the final day of the Hiroshima Pass, and activate the Hokuriku pass on the next day, you can stretch it to nine days of coverage.
The problem is getting back at the end, because the Hokuriku Pass stops at Tsuruga. A rapid service train from Tsuruga to Kyoto takes 83 minutes, and cost 1690 yen, so just pay it. A second option would be to get a one-day JR Kansai Area pass for 2400 yen, which would get you from Tsuruga all the way to Kansai Airport. I am going to include this in the estimate.
https://www.japan-guide.com/e/e2361_03.htmlCost breakdown:
JR Kansai Hiroshima pass- 15000 yen
Return Bus on Shimanami Kaido - 2300 yen
JR Hokuriku Pass - 5090 yen
1 Day JR Kansai area pass - 2400 yen
Total - 24790 yen.
This might work for you.
Good Luck, in planning your trip.