optimize_png: Only remove files on successful install

OptiPNG install removes tar.gz regardless of failure.
Keep it so that it can be looked into on install failure.

Signed-off-by: Luis Cruz <ljc2491@gmail.com>
optimize_png: Improvements & fix-ups

This script was a byproduct of insomnia. As such, it was mostly
worked on at 2 a.m. The code reflected that and was also partially
untested.
Make some fixes/corrections based on testing.
Also added SHA-1 hash checking for downloaded files.

Signed-off-by: Luis Cruz <ljc2491@gmail.com>