make shrinking images optional

fix some tab/space padding in code
fix internal function removeIfContains