Fixed the ref in imageDao to update the current state.