Is my code hacky? If so, I'd love some help

Is my code hacky? If so, I'd love some help

I am creating a grid of thumbnails. When a user hovers over a thumbnail, the image enlarges. The *trick* is, I want the "active area" to only be the size of the thumbnail. That is, the thumbnails are 180x120, and when the mouse leaves that area, I want the large image to shrink back to normal size. I have a working demo here:  http://www.norabrowndesign.com/testLayouts/expanding-photos-li.html

The way I accomplished this feels hacky though, and I's like to know if there's a simpler/more elegant way to accomplish it. The thumbs are an unordered list of images. Here is my javascript:
  1. $(document).ready(function(){
  2.     $('li').append('<div class="test"></div>').mouseenter(function(){
  3.         $(this).css('z-index',1000);
  4.         $this_img = $(this).find('img');
  5.         photo_pos= $this_img.position();
  6.          $this_img.css({
  7.             'position': 'absolute',
  8.             'top': photo_pos.top,
  9.              'left': photo_pos.left,
  10.             'z-index': 1001
  11.         }).stop().animate({
  12.             width:600,
  13.             height:400,
  14.             marginLeft:-20,
  15.             marginTop:-10,
  16.             padding:10
  17.         });
  18.         $('.test',this).css({
  19.             'top': photo_pos.top,
  20.             'left': photo_pos.left
  21.         }).mouseleave(function(){
  22.             $(this).prev().stop().animate({
  23.                 width:180,
  24.                 height:120,
  25.                 marginLeft:0,
  26.                 marginTop:0,
  27.                 padding:0
  28.             },function(){
  29.                     $(this).css('z-index','auto').parent().css('z-index','auto');
  30.             });
  31.         });
  32.     });
  33. }); 
In essence, I add an overlay div over each thumbnail which acts as the trigger to shrink the enlarged image. I thought I could use the parent <li>, as it doesn't appear to expand with the image (since I've set its size in my CSS) but that didn't work. 

Any feedback is much appreciated!