I believe that you need more RAM.
10.7 is very old and would run in a small memory footprint. Yosemite and El Capitan are much newer, they will require higher minimum specs. I would suggest you look to buy a second 2Gb RAM card matched as best you can to your existing one. Install only the two 2GB cards.
If your budget can stretch, buy more 2Gb cards. You will benefit from it...
I'm beginning to think this is the issue also. I've come across many others who were having the same issue as me and said that the kernel panics stopped once more RAM was installed. I have just purchased two of these RAM kits (16GB total) from eBay(link). I'm really hoping this would fix my problem