Fixed bug when uploading pictures