jQuery Photo Gallery Refactored