added Thumbnail preview and fixed few bugs.