fixed some bugs regarding picture