fixes to image uploading using UI dialog