This happens when the setLastComment function is called on a category that doesn't have any more images/albums in it:
Whoops\Exception\ErrorException: Attempt to read property "album_id" on null (2)
#0 \applications\gallery\sources\Category\Category.php(625): Whoops\Run->handleError(2, 'Attempt to read...', 'C:\\wamp64\\www\\d...', 625)
#1 \applications\gallery\sources\Category\Category.php(580): IPS\gallery\_Category->setLastImage(NULL)
#2 \system\Node\Model.php(1084): IPS\gallery\_Category->_setLastComment(NULL, NULL)
The setLastComment() function in turns calls setLastImage() which contains this code:
If no image is passed to the function, the code tries to load the last image in it. However, when there is no image the $image variable remains NULL and causes the error to be thrown. The code after the save() call needs a simple check to see if the variable is set before trying to load the album_id value:
if( $image !== null AND $image->album_id )