fix+optimize image splitting