diff --git a/app/Dockerfile b/app/Dockerfile
index f87513b797932a68f206449dd6aa14e2a06135c9..2ca1b670eedb2fd5169a779182437fd866ced130 100644
--- a/app/Dockerfile
+++ b/app/Dockerfile
@@ -14,9 +14,6 @@ ENV PYTHONUNBUFFERED 1
 ARG VERSION_DATE="passthistobuildcmd"
 ENV VERSION_DATE=$VERSION_DATE
 
-# set work directory
-WORKDIR /usr/src/app
-
 # update apk
 RUN apt-get update
 
@@ -26,9 +23,12 @@ RUN adduser --system --no-create-home --ingroup uwsgi uwsgi
 RUN apt-get install netcat-traditional jpegoptim pngcrush
 RUN apt-get --assume-yes install libvips
 
-RUN pip install --upgrade pip
-
 COPY ./requirements.txt /usr/src/app/requirements.txt
+
+# set work directory
+WORKDIR /usr/src/app
+
+RUN pip install --upgrade pip
 RUN pip install -U -r requirements.txt
 
 COPY ./entrypoint.sh /usr/src/app/entrypoint.sh
diff --git a/app/apps/core/tasks.py b/app/apps/core/tasks.py
index 3f712953920ff692035b708404fbba40725742ea..750d5f6179967dd538bfedc7c8ada5a014e39c2e 100644
--- a/app/apps/core/tasks.py
+++ b/app/apps/core/tasks.py
@@ -509,7 +509,7 @@ def before_publish_state(sender=None, body=None, **kwargs):
         if (data[sender]['task_id'] == sender.request.id and
             not check_signal_order(data[sender]['status'], signal_name)):
             return
-    except KeyError:
+    except (KeyError, AttributeError):
         pass
 
     data[sender] = {
diff --git a/app/requirements.txt b/app/requirements.txt
index e4c626581711cbb17bf982be32f37e33c1b9edb5..2a8fea1cf96603bf9c7589293b48faead99df67b 100644
--- a/app/requirements.txt
+++ b/app/requirements.txt
@@ -24,3 +24,5 @@ django-compressor==2.4
 albumentations
 django-simple-captcha==0.5.12
 pyvips==2.1.12
+scikit-image==0.17.2
+scipy==1.5.2