complete the picture upload function