Check for entity type 'photo' before writing image tag in doT
Better style for username and timeago
Remove logging, use Math.min instead of if-else