Bugfix (#25): Progressbar correctly displays the state of the upload

Previously the progressbar was always set to 100% because of wrong calculation
of the percentage.