You have to account for all appropriate CSS classes, based on the number of columns passed to the shortcode. Here’s my CSS (borrowed heavily from Michael Fields), for handling from 1 to 10 columns:
.gallery {
margin: 0px auto;
text-align: center;
width: 100%;
min-width: 100%;
}
.gallery .gallery-item {
float: left;
margin: 0px auto;
text-align: center;
}
.gallery img {
border: 1px solid #cfcfcf;
}
.gallery .gallery-caption {
display: none;
}
.gallery-columns-1 .gallery-item {
max-width: 638px;
width: 638px;
}
.gallery-columns-1 .gallery-item img {
max-width: 600px;
height: auto;
max-height: 600px;
}
.gallery-columns-2 .gallery-item {
max-width: 300px;
width: 300px;
}
.gallery-columns-2 .gallery-item img {
max-width: 300px;
height: auto;
max-height: 300px;
}
.gallery-columns-3 .gallery-item {
max-width: 200px;
width: 200px;
}
.gallery-columns-3 .gallery-item img {
max-width: 200px;
height: auto;
max-height: 200px;
}
.gallery-columns-4 .gallery-item {
max-width: 151px;
width: 151px;
}
.gallery-columns-4 .gallery-item img {
max-width: 150px;
height: auto;
max-height: 150px;
}
.gallery-columns-5 .gallery-item {
max-width: 120px;
width: 120px;
}
.gallery-columns-5 .gallery-item img {
max-width: 120px;
height: auto;
max-height: 120px;
}
.gallery-columns-6 .gallery-item {
max-width: 100px;
width: 100px;
}
.gallery-columns-6 .gallery-item img {
max-width: 100px;
height: auto;
max-height: 100px;
}
.gallery-columns-7 .gallery-item {
max-width: 85px;
width: 85px;
}
.gallery-columns-7 .gallery-item img {
max-width: 85px;
height: auto;
max-height: 85px;
}
.gallery-columns-8 .gallery-item {
max-width: 75px;
width: 75px;
}
.gallery-columns-8 .gallery-item img {
max-width: 75px;
height: auto;
max-height: 75px;
}
.gallery-columns-9 .gallery-item {
max-width: 67px;
width: 67px;
}
.gallery-columns-9 .gallery-item img {
max-width: 67px;
height: auto;
max-height: 67px;
}
.gallery-columns-10 .gallery-item {
max-width: 60px;
width: 60px;
}
.gallery-columns-10 .gallery-item img {
max-width: 60px;
height: auto;
max-height: 60px;
}
EDIT
Here you can see an example of the markup and styles being applied, from calling the following in the Post Content: