What I do personally is have a field called someting like "images"..
Then I make a list of the files like this..
url1/image.jpg,url2/image2.jpg,url3/image3.jpg
then when a new image is sent connect to the database and store the information in that field into a variable..
$images=explode(',',$databaseField);
$count = count($images);
if($count<5){
$images = $databaseField.','.$newImagePath;
}
// save the new images into the database.
I'm not an expert but thats how I normally do it.. I like to use this method because I like to be able to store as few or many images into the database as I want to.