Config height value used prior to CSS value

The height set in config should be used instead of waiting for the CSS.

Sometimes the gallery may be hidden, then the height retrieved is 0, causing a fatal error.

To solve this issue, config value should be used if present.