In includes/sessions.php file,
find:
function login($user_name = "", $user_password = "", $auto_login = 0, $set_auto_login = 1) {
global $site_db, $user_table_fields;
replace:
function login($user_name = "", $user_password = "", $auto_login = 0, $set_auto_login = 1) {
global $site_db, $user_table_fields, $url, $image_id;
find:
$this->start_session($user_id, 1);
return true;
add after:
if (preg_match("/details\.php/", $url) && isset($image_id) && !empty($image_id)) {
redirect("details.php?" . URL_IMAGE_ID . "=" . $image_id);
}