If possible, you can use one picture, consisting of two.
For example, like this:

And there we are already changing the background-position
.
Below is an example:
$('input[type="button"]').on('click', function(){ $('.block').toggleClass('active'); });
.block { display: block; width: 225px; height: 150px; background: url('https://i.stack.imgur.com/FpEZQ.png') no-repeat top center / auto 200%; } .block:not(.active) { background-position: top center; } .block.active { background-position: bottom center; }
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <div class="block"></div> <input type="button" value="toggle">