Fix for SF bug #242 "Can not convert PSD to JPG or PNG (gm convert: Memory allocation failed)"