return image to caller, rather than writing it to a file