Add option to return preview image as a string.