compression modified to upload image