Image quality of the jpeg currently is uses SMF's default setting which is hardcoded into SMF itself but can easily be changed.
Requires one edit to
imagejpeg($dst_img, $destName, 65);
Replace 65 with the image quality that is needed 65 is 65%
So 100 would be perfect quality but takes up more space
There is also a request in to have this built into SMF Gallerly 3.0