If you're using my IP without my permission, saying your friend told you it was actually his IP isn't a valid defence.
I mean, maybe you can sue your friend later on, but that's between you and him.
All that matters to me is that you've used my IP without my permision.
That being said, anything published on the web should be free. E.g. if some don't want their image to be used, they should not publish it publicly in the first place.