It depends on how closely your painting resembles the photograph. I can't see any problem with using the information gleaned from any Geograph picture to inspire your painting. On the other hand, if you were to trace the photo and paint it over, you should credit the photographer for their contribution.
If you are in any doubt, just email the contributor (there's a link under the main picture) and ask them; I'm sure most will answer in the same way. You could offer to take a photo of your finished painting and send it to them as a thank you - many would appreciate that.