.gallerycontainer{
position: relative;
/*Add a height attribute and set to largest image's height to prevent overlaying*/
}

.gallerycontainer p { clear: both; color: #7D7667; font-size: 12px; font-weight: bold;}

.thumbnail img{
border: 0px;
margin: 0px;
}

.thumbnail:hover{
background-color: transparent;
}

.thumbnail:hover img{
border: 0px;
}

.thumbnail span{ /*CSS for enlarged image*/
position: absolute;
padding: 5px;
left: -1000px;
border: 0px;
visibility: hidden;
color: gray;
text-decoration: none;
}

.thumbnail span img{ /*CSS for enlarged image*/
border-width: 0;
padding: 2px;
}

.thumbnail:hover span{ /*CSS for enlarged image*/
visibility: visible;
position: absolute;
top: -292px;
left: -560px; /*position where enlarged image should offset horizontally */
z-index: 50;
}

.thumbnail:hover .ref{ /*CSS for enlarged image -> Referenzen*/
visibility: visible;
position: absolute;
top: -8px; 
left: -560px; /*position where enlarged image should offset horizontally */
z-index: 50;

}

