added improvements in media manager upload function