There's no need to resize an image to a size that's larger than the original image. In order to prevent that, we should:
- ignore all resolutions that are higher than the original resolution of the image
- if there are any resolutions that are higher than the original resolution, replace them with single resolution that corresponds to the original image's resolution
The points above apply also to the resolutions passed in resulting HTML.
We should cache the information about original image size to avoid probing the original image on every HTML request.