Template:External image/styles.css

.image-resize img { width: auto; height: auto; max-width: 100%; max-height: 100%; }