In List View with image position starts with 0 but in your list is index 1, that is the reason you set local delete to get global index_apagar + 1
In List View with image position starts with 0 but in your list is index 1, that is the reason you set local delete to get global index_apagar + 1