bug fixes for photo_url functions and other errors