The pink lines are not a good sign since that could indicate a failing GPU or something related. Good that it's all white now, but there's a good chance that would come back, particularly under load.
However the ?folder likely just means the hard drive is dead (or else missing).
Do you have access to another Mac? If so, you can use that other Mac to make a bootable USB OS X installer drive. All you need is a 16 GB or larger USB drive, and an OS X installer file (which you can download directly from Apple). Google will tell you what commands are needed to create the USB installer from that file.
If you don't have the macOS installer file handy, you can
download the High Sierra patcher application, which includes a
menu option to download OS X High Sierra direct from Apple. (That downloads the untouched installer for people to patch later, but you don't need to patch High Sierra for that machine, since High Sierra is natively supported.)
What I would suggest is using the USB installer to install High Sierra on an external USB drive. Booting off USB 2.0 will be slow, but if High Sierra works fine, then you know the machine is usable. Once you've confirmed the machine is working fine, then you can take on the project of disassembling machine to install a cheap SSD in there to make it a fast machine again. If you get this far, then we can give you a few pointers about doing the SSD install. Specifically, if you don't do something about the hard drive temperature sensor, then the iMac will run the fans at maximum, which obviously is not ideal of course.