Hello
I run VB3 and this surely solved the issue for me here as I had the same issue when I checked into this and I tested on multiple installs this fix before posting this resolution. Problem was not initializing the variable so I went back through to an old version 4.8 to see what was missing. The only difference was this one line as noted. I then tested on my VB3 and it works as expected.
I will wait for others to test here in this thread that have reported it but so far I see no other issues here.
I suggest you run the query in uploadphoto.php for a specific user on the upload limit and see the results you get as I previously stated. Sometimes one does not realize they actually uploaded that many photos in a 24hour period. Always the first thing to check before moving on.
With this fix I very simple tested this. I registered a regular user account on my
VB. I as admin set uplimit to 2 per day. I then uploaded a photo without the fix and encountered the issue sporatically as others noted. I then initialized the variable and deleted all photos and tried again. It worked as expected. At least this is what I found in my testing.