Fixed js for resizing images