Tiled Gallery: Minor refactoring to maybeSetSizeAttributes.