coded decompression and thumbnail creation. Write thumbnail back to database field.