Add tests for image visibility filter in db

Some aspects of visibility filtering in the db api were not being
tested. This patch adds tests to ensure visibility=public|private is
working properly.

Change-Id: I67a4b8e33fab6f4f8f1ed4b05b2b8cac10153105
Merge "Add tests for image visibility filter in db"