Added `cot_img_check_memory()` function and applied it to `cot_imgresize()` for #1270.
Merge branch 'master' of github.com:Cotonti/Cotonti