What I did instead was to use <span>
elements:
<span class="left"></span>
<span class="right"></span>
Then I made them work as buttons with CSS by providing a background, corresponding size, etc. So I am using <span>
instead of <img>
and everything is behaving exactly the same way as before.
UPDATE 1
Following up with @sean's advice in the first comment to this answer, it happened what I thought that would happen:

See the border. Yes, I can remove the border with CSS but those default behaviors sometimes I do not like because what if in some browsers it looks fine without border but only some browsers add that border by default, and sometimes I do not know specifically which browsers add what, but in general I guess only the border should be the thing to worry about in terms of presentation and style.
UPDATE 2
Also, see the dotted lines on the left arrow button. Those appeared after I clicked the left arrow button and this only happens on Firefox. Fortunately, I could apply this answer that I found at How to remove Firefox's dotted outline on BUTTONS as well as links?:
button::-moz-focus-inner {
border: 0;
}
