fix deleting images from gallery