Updated pictures.php, fixed bugs in pictureLib.php

Removing picture works, but updating interface based on result is not.
Also fixed some bugs.