Only save photo information to database if upload was successful