Update lib.php

Added get photo function