sperate the upload function into resize and push