updated with initial work for subimage