Prevent orphaned images folder deletion from crashing Insight (rebased onto develop)



This is the same as gh-1481 but rebased onto develop.

----

Deletable things should still be deletable, and attempts to delete other things should not crash Insight.