Thumbor (https://github.com/globocom/thumbor) is a great Python library for helping cropping which uses openCV for facial detection (as well as other algorithms for finding "interesting" parts of photos)
We used specifically named sizes to avoid that problem although whitelisting in the edge servers would also work.