There's nothing in the law that specifically bans taking photos, but the Electoral Commission very strongly discourages any photography inside a polling station, primarily because of complex laws about maintaining the secrecy of the ballot. For instance, it's illegal to reveal how someone else has voted, which could happen inadvertently via a sloppy selfie. In addition, taking a photo of a ballot paper's unique identification number is against the rules. The key is a law against releasing any information "obtained in a polling station", which is in order to protect the integrity of the poll.