fix some bugs in the image server