Update document.php

added function to upload image and generate thumbnail.