refactor photo thumbnail loading