fix photo cap calculation