Added database prefixes; training (recording) of symbols seems to work; added gallery (which does not work by now).