Improved upload UI and fixed js error