Take a look @ your adv_gallery_images table via. phpMyAdmin.
Browse the table and find out what the last imageid is on the last record added.
Hit: Operations Tab
At the bottem of the page is AUTO_INCREMENT under table options section.
Add 1 to your last / largest imageid and save.
EX: If your last record has imageid 2000 then place 2001 in the AUTO_INCREMENT field.