Попробуйте что-то вроде этого
#overlay {
position: relative;
height: 630px;
background-position: center top; /* Center the image */
background-repeat: no-repeat; /* Do not repeat the image */
background-image:url("images/g.jpg");
max-width: 100%;
background-size: cover;
}
Вы также можете заменить background-size:cover;
на background-size:fill;