Well, there should be a way ... there often/usually is.
Is there a unique key? Like:
<?php
// upload code and stuff up here
// then you write to the database
// let's find out how many rows were written
$num_written=mysql_affected_rows();
// OK, let's use the unique key to get that many
$sql="select * from image_table order by unique_key desc limit $num_written";
$res=mysql_query($sql);
Does that get ya started?