fixed some bugs and add image download