I think it is useful to log something to file lile the SQL query and the result of saReader.
Give me update on it.
I tried that and it didn't give me any error to the database (I'm sending the errors to database instead of text file)
EDIT : I just got it sorted out and I really have no idea why it got fixed , what I did is adding "Else" statement with the if and that was it , If user is logged I grab the picture otherwise I don't ...
I didn't thought it would fix the issue but well , Glad it did even if I'm not sure how and why xD because that still doesn't explain why I wasn't able to grab the picture when I was logged before