python - <<'PY'
from PIL import Image,ImageDraw
from pathlib import Path
files=list(sorted(Path('/workspace/scratch/hard').glob('*.jpg')));o=Image.new('RGB',(1500,5*365),'#dedede');d=ImageDraw.Draw(o)
for i,p in enumerate(files):
 im=Image.open(p).resize((500,333));x=(i%3)*500;y=(i//3)*365;o.paste(im,(x,y));d.text((x+5,y+334),p.stem,fill='black')
o.save('/workspace/scratch/hardcontact.jpg')
PY