maps images swap function