Add col_first and col_last classes for one-column galleries

If you create a gallery with only one thumbnail per row the CSS class `col_first` is missing.

Related Issues: #2803, #5140