Defer opening gallery files until read/write are first called

Don't open gallery files in init, instead defer opening until they are
first attempted to be read from/written to.

This instead of introducing read/write modes.
Merge pull request #290 from biometrics/defer_open

Address issues #242, #192