fixed upload photo (just need to activate AWS for it to work), and added a function to help prepare for pagination