Tensorflow also implemented functions for resizing/padding images tf.image.pad tf.pad.
padded_image = tf.image.pad_to_bounding_box(image, top_padding, left_padding, target_height, target_width)
padded_image = tf.pad(image, paddings, "CONSTANT")
These functions work just like other input-pipeline features of tensorflow and will work much better for machine learning applications.