task-2: db bugfixes, wrote test code for viewing images in grid view.