resize images on the fly if needed.