Is your iMac a early white 2007 model or mid to late silver 2007 model?
How much free space on the HD is left?
How much RAM are you running?
Have you tried repairing permissions using Apple's Disk Utility?
Try using something like OnyX to clear out a lot junk in your system?
http://www.titanium.free.fr/download.php?sid=46093cfa2cb9132156099a3eaffa02ae
If your iMac has only the minimum RAM it shipped with, you may need to increase your RAM to the Max. amount your model iMac can take.
The 2007 white iMac can take 4GBs of RAM, but is only cpapble of addressing 3 out of the 4GBs.
Later 2007 iMac models can take a Max. of 6GBs of RAM. Installing the Max. amount of RAM will help, somewhat, with your issues, also.