Using QFile to save the image, so we can do a waitForBytesWritten()
Adding documentation and closing the file