...mhhh...
i use 4 file .php for any db:
p1: the first is the form to create/update/cancel any entry, in this case any image.
p2: the second is a form to do any search.
p3: do the SELECT with any search parameter , if exists. This is paginated
p4: the last do the insert, update and delete.
My index are usually a menu of 3 link: create, search, list
create call p1 with no param (=> the from is empty) that call p4 for an insert.
search call p2 that call p3 with search param, that call p1 with selected id (=> the form is full) that call p4 for a delete or update. May be cool to switch directly to p4 if found=1...
list call p3 with no param that call p1 with selected id (=> the form is full) that call p4 for a delete or update.
This will reduce to min the code shared from more file...
Use of include it's usefull but must be care because sometime we have to send param with get & post together. (but if you look my www it's made with include...)
The function is usefull if any work must be done in more place.
e.g. the connection to db that is done by every page...
I hope this answer to you...
see you