update uploading and loading pictures function