is there a way to remove width and height attributes? Passing None doesn't work, It will use the namedblobfield tag which will use the original image width and height. Looking at the code, it is not possible, meanwhile I'm using a regexp to remove them.
Why do you want to remove width and height? Even when the displayed width and height don’t match the image dimensions, it gives browsers a hint which aspect ratio the image will have. Knowing the aspect ratio beforehand (before the actual image is loaded, especially on slow networks) will let the browser know how much space to reserve for the block. This prevents layout shifts and reduces your LCP and CLS metrics.
I agree but with responsive images (for example .card-img-top in a BS card) it can be a problem. Here:
images width & height are not set and usually they are not. With css, height and width attributes should be unset. For browser hint (responsive images), just set the container. Also intrinsic sizes and other techniques are available.