It appears that {$User:redirect_uri} returns nothing (i.e. that the redirection filed looks like this: <input type="hidden" name="RedirectURI" value="" />)
This goes for any login/logout from any part of the site (admin,intranet..)
I did as was proposed. I upgraded to 3.3-4, and the problem was solved, only now the images are not shown. New images are, but all the old ones are "gone"..