get_image_id method + use in email template

Closes #5288