updated to automatically split all images