Hello! My name is John, I will work diligently to provide accurate advice and information.
Lock ups such as this often indicate hard drive issues. Since the standard Recovery is not working well for you currently, see what internet recovery will do:
Shutdown your Mac.
Restart and, as soon as you hear the startup chime, hold COMMAND + R + OPTIONS keys until you see the Apple logo and progress indicator.
Wait for “OS X Utilities” menu to appear (DO NOT CHOOSE TO INSTALL)
Choose Disk Utility from the available options.
In Disk Utility, select your normal, bootable hard drive volume from the list in the sidebar (usually "Macintosh HD").
Then, Click "Repair Disk"
If it finds errors, repeat the process until it reports the drive is OK.
Next, click "Repair Disk Permissions"
Then, restart your Mac and see if it will boot back into your normal Desktop.
If that does not work or there still seems to be issues;
Power off the iMac.
Unplug the iMac's power cord.
Wait a minimum of fifteen seconds.
Attach the iMac's power cord.
Wait at least five seconds, then press the power button to turn on the Mac back on.
See if there is any improvement.
If you continue to have questions on this topic, just reply back to this discussion. I will be more than happy to work with you further. Hopefully, this info will answer your question. If so please, please remember that when you are asked to give a rating, you are rating my personal service only and not this website itself or your issue.
Thanks and good luck,