I can't select the .current section

I can't select the .current section

Hello
I'm stuck. I've the following structure:
  1. <section class="gallery" id="media-home">
  2.         <ul class="list">
  3.             <li class="selected">Photos</li>
  4.             <li>Videos</li>
  5.             <li>Attachments</li>
  6.             <li>New</li>
  7.         </ul>
  8.         
  9.         <section class="gallery-item current">
  10. ………
  11.         </section>
  12.         <section class="gallery-item">
  13. ………
  14.         </section>
  15.         <section class="gallery-item">
  16. ………
  17.      </section>
  18.          <section class="gallery-item">
  19.         FORM
  20.         </section>
  21.     </section>


  22. $('.list li').click(function(){
  23. var which = $(this).parent().parent().attr('id');
  24. var ide = $(this).index()+1;
  25. $(this).parent().find('.selected').removeClass();
  26. $('#'+which+' .gallery-item').find('.current').removeClass(' current '); // <<< HERE IS THE PROBLEM!!
  27. $('#'+which +' .gallery-item:nth-of-type('+ide+')').addClass('current');
  28. $(this).addClass('selected');
  29. });
I don't know why the script doesn't hide the previous current section... I can't use the .gallery-item directly because I have two like this and if I use the class the changes applies in both of them. Does anybody know what could be happen?
Thanks!