Add -strip to the $command variable for each type. That removed unnecessary profile data, comments, exif stuff etc, from thumbnail images, not needed in almost any circumstance. Full size, yes, possible, but even then rarely since this isn't a gallery program.

I did this, and reduced some thumbnails from 28kb to 4 kb. Mostly those coming right out of a photoshop export.

Couldn't figure out why thumbnails of similar content were showing up different sizes on the home page, ranging from 32 to 4 kb, and that was it. Now all show up in the 4-6 KB range (150 max setting).