moved ImageWidget::draw() code directly inside paintEvent().