Improved performance and runtime conditions

The original blocksize of 1024 is much too small to be efficient.  Changed write progress tracking to (hopefully) deal with image sizes that are not an integer multiple of the blocksize.