[{
name: '', descripton: '',
...
images: [{src: 'url', src_build: 'url'}, {src: 'url', src_build: 'url'}]
}]
select
portfolio.id, portfolio.name,
array_agg(json_build_object('src', photos.src, 'src_build', photos.src_build))
from portfolio
left join photos on portfolio.id = photos.portfolio_id
group by portfolio.id, portfolio.name
;