Fixed uploads page JavaScript bugs with event execution order