I find, like with many cameras, the lighting has a big affect. Do some test shots of the same thing in your house and compare how it comes out before and after adding more light. I think the picture will be alot better with the added light.
Yes, the lighting plays a big part of the quality of the iPhone's picture. Too much light produces grainy pictures, too little too dark. You have to find the happy medium.