I suspect the RAM may be faulty. Frequent crashes and/or kernel panics (grey screen with lots of gibberish showing) usually caused by faulty/wrong type of RAM. Swap it out for the old RAM (if you have it) and restart. If not RAM the HDD has probably failed. You should be able, with help, to replace the HDD or install an SSD upgrade. Hopefully, you'll have a back-up of your imac on an external HD, which you can use to do a new set-up.
This thread is now locked and can not be replied to.