The general rule of thumb is that if you are using a piece of media in a personal or educational project, you are free to use them. If you are not comfortable with that you can always attribute where you got it underneath the media.
If it’s commercial (you are selling anything) then you need to get in contact with the author to get permission. It’s just easier to go and buy photos from a site or a free photo site. Just make sure that you always read the license and follow it. You shouldn’t see any problems that way.
When I do a client’s website i get the photos that I want to use. In the PSD mockup I create create layers for each photo with the data of where I got them, who did the pic, and the date I got them. Then i just group the layers into a folder. Once the mockup has been signed off on and finalized. I send the links to the client and have them purchase them.
Then when I have use the paid ones when I build the website. This ensures that everything is legit and paid for. Then the responsibility is on the client and not me. That’s how i do it anyway.
When in doubt, attribute.