issue #655 resources / media were not being deleted in some cases
Merge branch 'hotfixes' into develop