Separate query from rendering

Prep for rendering wkb to image