train_writer = tf.train.SummaryWriter('summary_dir')
for i in range(N_BATCHES):
    img = tf.image_summary('fooImage{:06d}'.format(i), img_data)
summary, _ = sess.run([img, train_step])
train_writer.add_summary(summary)
How to use image_summary to view images from different batches in Tensorflow?