abstracting some of the photoloader stuff