Change thumbnail generation to run as bg task

Send HTTP response back to client after photos
have been copied to server. Continue thumbnail
generation from there
Refactor photos upload