setting the image in the ui thread