Various performance improvements

- Call to the php `getimagesize` require a disk access, which might not be fast at all, the first commit cache `getimagesize` result.
- Computing the thumbnail dimensions at each request is not needed, the third commit allow to compute the `salts` hash without computing the resulting thumbnail dimensions.

In case of remotely stored assets, this allow us to serve the thumbnail URL without accessing the original image at all. If the images are stored on S3 for instance, this is pretty much required.