Added helper function to convert a QImage to a QPixmap