Fixed displaying of grayscale images; fixed history DB inserts; fixed tests;