fixed a deleting images bug