bug fix deleting images in use