fix a bug when trying to publish images