It's a tricky issue. In many countries it's not illegal and quite common for children to run around naked in public, during the summer on beaches for example, and so millions of people have holiday photos that are technically CSAM in their possession that they don't even know they have.
CSAM has a meaning identical to child porn but doesn't make that meaning explicit. Drawn or generated depictions of child nudity can be considered CSAM in some jurisdictions.
> even if you took the picture yourself.
I'd hope the punishment is more severe in that case!