Fixed issue with deleting images