in your code:
$gallery = get_gallery(get_mediarss_url('gallery=' . $pg_id . '&thumb=62c&full=600p&super=339p'));
you are adding 2 new file sizes, 600p and 339p. these would need to need to be added to the proportional array:
$GLOBALS['resize_proportional'] = array(
array('w' => 1024, 'h' => 768, 'watermark' => true),
array('w' => 600, 'h' => 600, 'watermark' => true),
array('w' => 339, 'h' => 339, 'watermark' => true),
array('w' => 782, 'h' => 481, 'watermark' => true),
array('w' => 163, 'h' => 92)
);
then you would need to edit the watermark in the gallery to have the images regenerated.