fixed delete_images func