fixed bug for upload local picture and clean codes