fix bug with outputting photos