Fix issue with user input in CommandLineUI and add type checking to UI passed in to Gallery.
We want strict type checking for the GalleryUI because we have expectations about its interface.
For user string input, need to use raw_input() instead of input().