Code refactor for marker icon dialog and image dialog