.gallerycontainer{
position: relative;
/*Add a height attribute and set to largest image's height to prevent overlaying*/
}

.thumbnail:hover{
background-color: transparent;
}

.thumbnail:hover img{
border: none;
}

.thumbnail span{ /*CSS for enlarged image*/
position: absolute;
background-color: #f0f9f8;
padding: 5px;
border: 1px solid #003366;
visibility: hidden;
color: black;
text-decoration: none;
}

.thumbnail span img{ /*CSS for enlarged image*/
border-width: 0;
padding: 2px;
}

.thumbnail:hover span{ /*CSS for enlarged image*/
visibility: visible;
top: -50;
right: -35;
z-index: 50;
}