save/load images + correctly deal with port numbers