I would like to uise this code in some of serverless solution e.g. Azure function. How to return this thumbnail in a request?