First of all, thanks for the mod.
There are a few things that are not quiet right.
1) you've copied entire details.php into comment_pop.php - why? All it needs a part that saves the comment, it doesn't need anything else. And besides, provided comment_pop.php file doesn't work on fresh 4images, there are some parts left from your early modifications (it's always a good idea test it on unmodified 4images
)
2) in comment_pop_form.html template you are using comment_pop.php in the form without parsing it through $site_sess->url() function, it can break sessions, and to make it maximum compatible with integrations, image_id must be replaced by constant URL_IMAGE_ID when parsing trough url() function. Also, there is some google code left from your site.
3) in details.html template you are adding new tag next to {rate_form}, which means if visitor not allowed to rate, they won't be able comment as well (link for comments will not be showed).
4) the link for pop will be showed even if visitor not allowed view comments, it's easily fixed by using {if comment_form}{comment_popup}{endif comment_form}
5) 4images is already suffers from having too much HTML code inside .php files, your javascript code is unnecessary placed inside details.php
6) since you are not providing any scirpts to update database with default values, you'll need to mention, that after installing this mod, one must go to ACP->Settings and manually enter width/height numbers for the popup dimensions.
7) would be nice if the popup close itself when comment successfully added.