Updated image resizing to give nearly 10x speed improvement.