subito dopo index = index + adres.indexOf(".bmp");

scrivi

if(document.image.width.value>tuo valore | document.image.height.value>tuo valore2){
alert('Immagine troppo grande')
return false;
}

Prova così