Fixed invalid write test
Added function to get image record
Added function to check if imagerecord is valid
Updated entryExists function to use odb
Added check for existing entries when adding new data