Make "private" functions that shouldn't be exported

Currently, the db_api defines some functions that are used for accessing
images data but some of them are for internal use only. In an effort to
improve consistency, I've made some of those functions - the ones that
are not accessed outside the db_api - private by prepending their names
with an "_".

Most of this functions were defined within sqlalchemy and as such didn't
required any change in the simple driver, others though, required a
change in both drivers, i.e. get_session.

This patch implements part of the blueprint registry-api-v2.

NOTE: During the review, try to find functions that should be private
and haven't been changed.

Change-Id: I6342dc94ebf2a35d6bc9bd7698b81a94ffa13373
Merge "Make "private" functions that shouldn't be exported"