diff --git a/ckanext/odsh/pdf_to_thumbnail/enqueue.py b/ckanext/odsh/pdf_to_thumbnail/enqueue.py
index c7840794b6c37fade613e215c4a52dfc22e0b247..991093222617aee499afaaead7182ca343926991 100644
--- a/ckanext/odsh/pdf_to_thumbnail/enqueue.py
+++ b/ckanext/odsh/pdf_to_thumbnail/enqueue.py
@@ -99,7 +99,6 @@ def enqueue_after_delete(context, resources):
         private = package.private
         package_id = package.id
         first_resource = resources[0]
-        package_id = first_resource.get('package_id')
         
         # without the background job
         create_thumbnail_for_last_resource(resources, private, package_id)
diff --git a/ckanext/odsh/pdf_to_thumbnail/thumbnail.py b/ckanext/odsh/pdf_to_thumbnail/thumbnail.py
index d53430174d1fa7487c71e229e4d8fea48c82f73e..ac8b6fcf53875ec41f0a602249889ab6abf5e44f 100644
--- a/ckanext/odsh/pdf_to_thumbnail/thumbnail.py
+++ b/ckanext/odsh/pdf_to_thumbnail/thumbnail.py
@@ -65,11 +65,11 @@ def create_thumbnail_from_file(file, package_id, private):
         old_filepath = get_filepath_for_thumbnail(concatenate_filename(filename))
         if os.path.exists(old_filepath):
             os.remove(old_filepath)
-    convert_from_bytes(file_read,
-                       dpi = 50,
-                       #size=(width, None),
+    path_to_image = convert_from_bytes(file_read,
+                       size=(width, None),
                        output_folder=directory,
                        output_file=filename,
+                       single_file = True,
                        first_page=0,
                        last_page=0,
                        fmt='jpg'