contrib: improve optimize-pngs.py
- Check that image contents match pre- and post- crushing.
- Also remove use of external tool to compute sha256 in favor of hashlib.
- contrib: remove all use of shell=True in strip_pngs.py Using shell=True can be a security hazard. See e.g. https://docs.python.org/2/library/subprocess.html#subprocess.check_output