to root your device when you have access to image you can copy init_boot_a.PARTITION file from image and push it to your device then patch it with Magisk app. pull it from device and flash it on device. I replaced it with original init_boot_a.PARTITION and repack again and flash whole image.

this is step by step guid:

Magisk Document