The ruling that allows the ban on child pornography is based on two SCOTUS decisions: Miller v. Califorina, which legally defined "obscene" and declared obscenities to be beyond the protection of the First Amendment (just an fyi, the definition includes that the material is lacking in "serious scientific, literary, artistic, or political value" which the courts usually don't hold a high threshold of quality above. Obscenity laws are also, per Miller, to be in the power of the most local levels of governance among a body of people (so while the U.S. cannot ban content on a web forum, the forum's own rules may).
The other case is law is New York v. Furber which held that there is a compeling government interest in protecting the physical and mental health and well being of a child and that the manufacture and sale of child porn leads to the abuse of children and tramautic memories of the experience that last for much of their lifetime that overrides any protection offered by the First Amendment, thus the material need not be legally obscene to make illegal.
It's that compelling government interest that forms the basis of the answer. Because that is the justification for the illegalization of child porn and as such it would not always fall to obscenity laws without the interest, there is a bit of a loop hole. To be illegal, the pictures in question must have a real child featured in the porn in question. Thus pictures depicting fictional characters in their entirety (such as cartoon depictions of children) and erotica (literature featuring sexual content) are not illegal under Ferber and must fall to Miller to determine if it is illegal.
Because Miller leaves the rules to the lowest level of community law possible, these pictures can be against the rules of many websites, 4chan is (in)famous for having next to no standards, this kind of material is perfectly legal on this site as far as higher levels of government are concerned and it falls to the moderation team of 4chan (such as they are) to limit the offensive content.
It is because these materials do not depict actual real children that they are legal. This is due to the fact that these works can just barely qualify as having an artistic or literary value (the bar is very very low as to what qualifies as "merit" under Miller). It's also acceptable to make pictures of a real child portraying a fictional character who in the story is a victim of child pornography, regardless of the work's depiction so long as you aren't actually having the child actor strip on camera. This can be done by giving the child flesh colored clothing that covers the areas deemed obscene and using shoot angles that depict the child's skin that is legally allowed to be exposed (to hid the fact that for legal reasons the child is legally dressed on the set. Other production tricks are to hire actors who are older than 18 years old, but look younger than they are and can play a kid.). So long as you are not actually making child porn (showing the "no-no areas" on a real child), you can make fiction works that depict fictional characters involved in such activities in artistic ways to make any statement you want on the subject matter.
In your two examples, Operation Avalance targeted sites that had materials such as pictures and videos that depicted actual children in pornographic situations. In the case of the Megaupload, the U.S. was requesting extradition for money laundering and racketeering in connection with the legal seizure of Megaupload following investigations into the site concerning digital piracy. I'm unaware of actual instances of child porn involved, but not saying it's not impossible. Extradition only works if the country requested (Here New Zealand) chooses to honor the request (the U.S. and New Zealand have an extradition treaty and very similar laws so extradition is both required per treaty when requested AND the accused person would face similar charges if the crime was committed in the requested country.).