image auto and database swtich