Far better now, but not enough to keep the aditional images.
That's because you don't check the thumbnails correctly for the additional images.
As I said in my previous post they use the "show_image_in_imgtag.php", so the script will never find them in the resized folder, and so the &remove still say true.
You need to also, in complement of the query to select at least the "file_image_thumb_height" and "file_image_thumb_width" and happen them to the source image name.
I got additional image called "nextimagecd.jpg"
I've resized it to 74 x 90 so now, stored in the resized/ folder with the name nextimagecd_74_90.jpg
There is nothing stored for nextimagecd_74_90.jpg in the db, only dynamic stuff here.
$remove will return true.
I think that we need a regex with a preg_match for this on the image.
If boolean is 1 , then explode to retrieve the "file_image_thumb_height" and "file_image_thumb_width" to consolidate the query.