Fixed creation and saving of images received over tcp for windows.