fix bug: local image file may not be closed correctly
add a new configurable item: DEBUG_FETCH_MAX