Another follow up. I ran into cases where the first few photos were centered fine but the later ones were not. When you refreshed the page they were all centered.
If the code is run in jquery ready() the photos may not all be loaded yet. Fix for this is to make sure they have width and height tags.