move path generation for previews to dedicated function
fix return value of method