If you are in the United States, you aren't likely to be jailed for posting a story that violates Canadian law in any case.
As for US law, no mater how young the characters, you can't be prosecuted on a child pornography charge for a story as it's protected by the first amendment. You could potentially be prosecuted on an obscenity charge, but this is rare and the few cases of it happening that I have read about involved not just under-age sex, but violent rape and/or torture of children.
The US Supreme Court originally carved out an exception to the first amendment for child pornography due to the harm done to the children used to produce it. Congress tried to ban virtual child porn (stories, drawings, films using adult performers who look under age) in the late 1990s, but it was overturned by the Supreme Court.
That said, due to Canadian Law, which would allow our host to be prosecuted, the site now has a policy prohibiting stories with characters under 14 in sexual situations.
Age restrictions: Your work (stories, poems or blog entries) may not contain characters younger than 14 having sex or being in sexual situations (masturbation and nudism are not allowed). In other words, all characters that engage in any sexual activity must be 14 or older. (Stories posted before September 2011 are not subject to this rule, including new chapters to stories that were in-progress when this rule came into effect.)
Canadian law changed in 2011 prompting the creation of this rule.
RE: Age of consent,
In the US, this is established by state law and is not uniform. Depending on what state you are in the age of consent could be 16, 17, or 18 and there may or may not be exceptions for both under age or for close in age with one adult. 16 is the most common under current law and 18 is the least common. This has nothing to do with the age standard for child pornography which is set at 18 by federal law.
So yes, there are states where a guy could go to jail for having a nude photo of a girl he could legally have sex with.