I obliged, thinking at least I'd get a credit
It's unfortunate that you did not get credit, but allow me to kindly turn the iron in the wound a little bit. That's why I underlined that particular word in your post. I think you should never assume, in a professional context, that people will do things properly on your behalf.
This situation might be a result of error, not malice (e.g. your friend was not fully aware of the need to credit photos, and the photo editor just assumed that the photo he received belonged to your friend, thus negating in his mind the need to ask for permission). But in the end, the error is the same.
I would suggest you simply write a brief letter to the magazine, cc: your friend, explaining the situation. In their next issue, if they are diligent, they will put a small errata to correct the situation. It's annoying, but at least you get a tangible result.