Refactor PrettyPhoto plugin.