Try this one , I do this code - Demo here, Very easy and simple code ( I have used a hack code and extra span tag for only IE old version)
http://jsfiddle.net/ERuX4/1/
css
.wraptocenter * {
vertical-align: middle;
}
.wraptocenter span {
display: inline-block;
height: 100%;
width: 1px;
}
.wraptocenter {
display: table-cell;
text-align: center;
vertical-align: middle;
}
/*End wraptocenter - image Vcenter patch styles*/
.demo {
width:100px;
height:100px;
border:1px solid red;
position:absolute;
top:50%;
left:50%;
margin-top:-100px;
margin-left:-100px;}