Dynamically generates a thumbnail for an image, stores it in the cache and renders it.
string $filepath - Path to an image file.
mixed $dimensions - String or array of dimensions. For example [300, 400] will create a thumbnail with width of 300px and height of 400px and '300' will create a square image of 300px.
string $fit - Sets how the image is fitted to its target dimensions. Can be "contain", "max", "fill", "stretch" or "crop".
mixed $source - Source directory to search for the image. By default it's the public folder.