fixing bugs in img mgmt