Probably by hashing your files and comparing them to a known list of "banned content". I imagine this is one of the ways Gmail disallows child-porn or malware to be sent.
Less likely but more worryingly it could be skin-tone detection and other pornography detection algorithms with a human filter.
Less likely but more worryingly it could be skin-tone detection and other pornography detection algorithms with a human filter.