diff --git a/src/calibre/ebooks/lrf/html/table_as_image.py b/src/calibre/ebooks/lrf/html/table_as_image.py
index f4bdfa973d..6db42865be 100644
--- a/src/calibre/ebooks/lrf/html/table_as_image.py
+++ b/src/calibre/ebooks/lrf/html/table_as_image.py
@@ -10,6 +10,8 @@ import os, tempfile, atexit, shutil, time
from PyQt4.Qt import QWebPage, QUrl, QApplication, QSize, \
SIGNAL, QPainter, QImage, QObject, Qt
+from calibre.parallel import ParallelJob
+
__app = None
class HTMLTableRenderer(QObject):
@@ -80,18 +82,17 @@ def render_table(server, soup, table, css, base_dir, width, height, dpi, factor=