MacBook stuck in Internet Recovery Mode
You can try installing Ubuntu (or any other Linux distro) onto a USB. Then, start a live session. Open GParted and reformat your iMac’s HDD or SSD to GUID. After that, try booting into recovery mode again.