Fixed bug when deleting a record where no image had been uploaded.