fixed bug for downloading pictures