implement loading image with a dialog