WP-2651 Added code to save the image id.