more verification before resizing image (closes #4204)