Fixed insert database and upload photo