We can resize image using CSS in the browser using media queries and the principle of responsive design.
@media screen and (orientation: portrait) {
img.ri {
max-width: 80%;
}
}
@media screen and (orientation: landscape) {
img.ri { max-height: 80%; }
}