Fix a bug when swapping the width and height in settings.
Test the settings and gallery modules with pytest.
Update travis config for pytest.
Merge branch 'pytest'