Image deletion bugfixes