centralize and fix x-accel for photos