Fix image resizing

Fix image resizing to work with upstream merge.

@kflorence