You can face prosecution if you are over 10 years old and caught sexting if the person in the photo is under 18, as it is “distributing an indecent image of a child”.
Source: Selfie sex text teens threatened with child sex charges @ BBC News
image by DariuszSankowski under CC0 license