fix bug in compressToBase64

re-set the 'enc' variables to zero so that they do not retain their
values from previous iterations in the loop.