tell application "Photos"
set alls = albums "Photos"
repeat with photo in alls
If you refer to the dictionary it helps to understand how each element is contained by other elements. To get the photos of all albums you have to loop through the media items of every album. This will get the filename of each photo.
tell application "Photos" activate set alls to every album repeat with photoAlbum in alls set photos to every media item in photoAlbum repeat with photo in photos get filename of photo end repeat end repeat end tell