Use nginx lua module to auto resize the image according to the pattern in the url.