My implementation of deleting images