If you're only storing the image path(s) in the database, you could just delimit each path, then split it on the way back out:
Into db:
/www/site/images/1.png|/www/site/images/2.png|/www/site/images/3.png|/www/site/images/4.png
Out from db:
$paths = explode("|", $dbvalue);
Or preferably modify your database schema to account for the feature properly.