First force quit out of iPhoto via the ➙ Force Quit menu. Now disconnect the iMac from the internet. Launch iPhoto, go to its iCloud preference pane and make sure the circled checkbox below is unchecked:
It sounds like you've dragged you hard drive onto the iPhoto icon in the dock an imported all of the image files on the hard drive, including this in the system and the various applications.
If that's the case restore you backup copy of the library that was made just prior to this occurring. You do have a backup strategy in place don't you?