Fix caffe.io.resize_image for the case of constant images

"resize_image" in python/caffe/io.py fails for the case of a constant image.  It returns NaN from a divide-by-zero.

This patch checks whether the image is a constant and then returns a new constant image of the correct shape.