https://www.machinet.net/tutorial/develop-python-script-automating-image-resizing-optimization