Fix resolve_image: avoid returning unicode