Try keeping variables more strongly typed as RecordSet instead of array
Count archives instead of sizeof
Save album works template as a partial
Use standard works partial in album view