This question has been answered by lx. See the first response.
<div id="carousel"> <a href="#" class="galFoto "><img src="img/placeholders/team-member.jpg" width="125" height="125" border="0"></a> <a href="#" class="galFoto "><img src="img/placeholders/team-member.jpg" width="125" height="125" border="0"></a> <a href="#" class="galFoto"><img src="img/placeholders/team-member.jpg" width="125" height="125" border="0"></a> <a href="#" class="galFoto"><img src="img/placeholders/team-member.jpg" width="125" height="125" border="0"></a> <a href="#" class="galFoto"><img src="img/placeholders/team-member.jpg" width="125" height="125" border="0"></a> <a href="#" class="galFoto"><img src="img/placeholders/team-member.jpg" width="125" height="125" border="0"></a> <a href="#" class="galFoto"><img src="img/placeholders/team-member.jpg" width="125" height="125" border="0"></a> <a href="#" class="galFoto"><img src="img/placeholders/team-member.jpg" width="125" height="125" border="0"></a> <a href="#" class="galFoto"><img src="img/placeholders/team-member.jpg" width="125" height="125" border="0"></a> </div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script> var $span = $("#carousel .galFoto"); for (var i = 0; i < $span.length; i += 2) { var $div = $("<div/>", { class: 'galGroup' }); $span.slice(i, i + 2).wrapAll($div); } </script>