Fixed ImageDao to record tagGroup ids correctly.