The only way this can be implemented is if one or more of the following are required:
You must verify your age by linking your digital devices to your ID.
You must allow the government or whatever private third-party agency the government employs access to your devices' data and files at all times.
You must allow third-party software to scan every attempted photo.
Note that these requirements would effectively apply to users everywhere, not just within the UK. Is this really just about protecting children?
Instead of decimating the privacy of every single person who uses the internet, and given the growing consensus regarding the harms to children from unlimited social media use, why not instead simply require phone and computer manufacturers to offer a parental control on phones and computers that enables parents to block access to social media, forums, chat rooms, and the like, while also requiring such platforms to identify themselves in a way that would facilitate such blocking. The control could include a feature allowing parents to designate particular exceptions to the block for sites that the parent trusts, e.g., if there were a school-related forum or chat room.
And I have to think that other approaches are also possible that wouldn't require the wholesale destruction of individual privacy rights; e.g., public education campaigns to make parents and children more aware of dangers, or simply outlawing phones for kids (I grew up just fine without one).