fix min atlas width when subtexture width = atlas width; also fix usage of safetyMargin