Got loading icon working again. Switched upload preview code from plain javascript to jquery