Este código muestra una imagen en una ventana con su tamaño real, sin conocer de antemano las dimensiones de la imagen, centrando además la ventana en la pantalla.
<A onclick="NewWindow(this.href,'name','not');return false" href="my_imagen.jpg">
<img src="my_imagen.jpg" border="0" alt="texto" width="75px" height="75px">
</a>
El código javascript necesario, es el siguiente:
var win = null;
function NewWindow(mypage,myname,scroll){
img = new Image();
img.src = mypage;
w = img.width; //Ancho;
h = img.height; //Alto;
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',
scrollbars='+scroll+',resizable';
win = window.open(mypage,myname,settings)
if(win.window.focus){win.window.focus();}
}