Cleaner code for single photo navigation (with Matt's help)