FIX: Handle the case where upload goes missing during downsizing

FIX: Handle the case where upload goes missing during downsizing

diff --git a/lib/shrink_uploaded_image.rb b/lib/shrink_uploaded_image.rb
index e5f57eb..43416ad 100644
--- a/lib/shrink_uploaded_image.rb
+++ b/lib/shrink_uploaded_image.rb
@@ -28,7 +28,12 @@ class ShrinkUploadedImage
     end
 
     # Neither #dup or #clone provide a complete copy
-    original_upload = Upload.find(upload.id)
+    original_upload = Upload.find_by(id: upload.id)
+    unless original_upload
+      log "Upload is missing"
+      return false
+    end
+
     ww, hh = ImageSizer.resize(w, h)
 
     # A different upload record that matches the sha1 of the downsized image

GitHub sha: cb048d28