This is already a solved problem. Medical schools teach anatomy, art museums display nude sculptures, sex education happens in schools, and National Geographic shows indigenous tribes without being classified as pornography. Courts have been distinguishing obscenity from protected speech for decades, and content platforms make these determinations millions of times per day. The existence of edge cases doesn't mean the distinction is impossible, it just means edge cases exist.