Fix progress bar updating during image write