function imgfix(){
var maxwidth=58;
var maxheight=58;
$("#test img").each(function(){
$(this).css("width",this.width>maxwidth && this.height/maxheight < this.width/maxwidth ? maxwidth:true);
$(this).css("height",this.height > maxheight && this.height/maxheight > this.width/maxwidth ? maxheight : true);
});
}