Reddit show images with real/full height

This script only use css

// ==UserScript==
// @name            	Reddit show images with real/full height
// @namespace       	https://greasyfork.org/users/821661
// @match           	https://www.reddit.com/*
// @match           	https://new.reddit.com/*
// @grant           	none
// @version         	1.2
// @author          	hdyzen
// @description     	This script only use css
// @license         	MIT
// ==/UserScript==
'use strict';

function addCSS(text) {
    const head = document.documentElement;
    const style = document.createElement('style');

    style.innerHTML = text;
    head.appendChild(style);
}

addCSS(`
.STit0dLageRsa2yR4te_b:has(._3hUbl08LBz2mbXjy0iYhOS, ._3b8u2OJXaSDdBWoRB7zUoK, img.media-element), .KVyBaj7FjzElWsqJDmw7v:has(._3b8u2OJXaSDdBWoRB7zUoK) {
    height: max-content !important;

    & ._1apobczT0TzIKMWpza0OhL {
        display: flex !important;
    }

    & ._3gBRFDB5C34UWyxEe_U6mD {
        display: none !important;
    }

    & ._3JgI-GOrkmyIeDeyzXdyUD, & [style*="left:0px"], & [style*="left: 0px"], & ._2Ev7WJU0f45KxlmClce9t8 {
        position: relative !important;
        height: max-content !important;
    }

    & .media-element, & .m3aNC6yp8RrNM_-a0rrfa, & [style*="max-height: 512px"], &&  [style*="max-height:512px"] {
        max-height: unset !important;
    }

    & :is(figure, li, ul), & ._1ti9kvv_PMZEF2phzAjsGW, & .KVyBaj7FjzElWsqJDmw7v {
        height: max-content !important;
    }
}
.rpBJOHq2PR60pnwJlUyP0 > div[style^="height"] {
    height: unset !important;

    & > .wwHbgRV0ZXGp5CHHlpo5u {
        display: unset !important;
    }
}
`);