Sorry to tell you that, but it will not work just like that...
4images is using "HTTP_REFERER" value. So, unless your browser (or other privacy control software/antivirus/firewall) is blocking referal pages, 4images should redirect you to the image you were trying to access before login.
And your changes are equal to removing what is in red:[qcode] if (!ereg("index.php", $url) && !ereg("login.php", $url) && !ereg("register.php", $url) && !ereg("member.php", $url)) {
header("Location: ".$site_sess->url($url, "&"));
}
else {
header("Location: ".$site_sess->url($url, "&"));
}[/qcode]