fixed error when no image selected in a widget