Better would be SELECT MAX(image_id) AS num FROM 4images_images
Cause your query shows only the number of images,
but beacuse of autoincrementing it would be better to know where which is at the moment the highest image id.
But i think too, that your problem isn't relating to this topic.