Fixed some bugs associated with spliting ImageManager into seperate files.