diff --git a/porespy/filters/__funcs__.py b/porespy/filters/__funcs__.py
index f24d97b24..d971f21b4 100644
--- a/porespy/filters/__funcs__.py
+++ b/porespy/filters/__funcs__.py
@@ -1712,11 +1712,8 @@ def chunked_func(func,
                 strel = kwargs[item]
                 break
         halo = np.array(strel.shape) * (divs > 1)
-    slices = np.ravel(
-        shape_split(
-            im.shape, axis=divs, halo=halo.tolist(), tile_bounds_policy=ARRAY_BOUNDS
-        )
-    )
+    slices = np.ravel(shape_split(im.shape, axis=divs, halo=halo.tolist(),
+                                  tile_bounds_policy=ARRAY_BOUNDS))
     # Apply func to each subsection of the image
     res = []
     # print('Image will be broken into the following chunks:')
@@ -1727,7 +1724,7 @@ def chunked_func(func,
         res.append(apply_func(func=func, **kwargs))
     # Have dask actually compute the function on each subsection in parallel
     # with ProgressBar():
-    #    ims = dask.compute(res, num_workers=cores)[0]
+        # ims = dask.compute(res, num_workers=cores)[0]
     ims = dask.compute(res, num_workers=cores)[0]
     # Finally, put the pieces back together into a single master image, im2
     im2 = np.zeros_like(im, dtype=im.dtype)
@@ -1752,7 +1749,11 @@ def chunked_func(func,
         a = tuple(a)
         b = tuple(b)
         # Insert image chunk into main image
-        im2[a] = ims[i][b]
+        try:
+            im2[a] = ims[i][b]
+        except ValueError:
+            raise IndexError('The applied filter seems to have returned a '
+                             + 'larger image that it was sent.')
     return im2
 
 

diff --git a/test/unit/test_filters.py b/test/unit/test_filters.py
index 47773ff69..07989d3f3 100644
--- a/test/unit/test_filters.py
+++ b/test/unit/test_filters.py
@@ -424,6 +424,16 @@ class FilterTest():
         b = ps.filters.fftmorphology(im, strel=s, mode='erosion')
         assert np.all(a == b)
 
+    def test_chunked_func_w_ill_defined_filter(self):
+        import scipy.signal as spsg
+        im = ps.generators.blobs(shape=[100, 100, 100])
+        with pytest.raises(IndexError):
+            ps.filters.chunked_func(func=spsg.convolve,
+                                    in1=im*1.0,
+                                    in2=ps.tools.ps_ball(5),
+                                    im_arg='in1', strel_arg='in2',
+                                    overlap=5)
+
     def test_prune_branches(self):
         im = ps.generators.lattice_spheres(shape=[100, 100, 100], radius=4)
         skel1 = skeletonize_3d(im)

chunked_func should deal with funcs that return a result of different shape than the input
for instance, the convolve function can return an image wtih padding around the outside that breaks the chunking later on in the function
test/unit/test_filters.py::FilterTest::test_chunked_func_w_ill_defined_filter
test/unit/test_filters.py::FilterTest::test_im_in_not_im_out test/unit/test_filters.py::FilterTest::test_porosimetry_compare_modes_2D test/unit/test_filters.py::FilterTest::test_porosimetry_npts_10 test/unit/test_filters.py::FilterTest::test_porosimetry_compare_modes_3D test/unit/test_filters.py::FilterTest::test_porosimetry_with_sizes test/unit/test_filters.py::FilterTest::test_porosimetry_mio_mode_without_fft test/unit/test_filters.py::FilterTest::test_porosimetry_hybrid_mode_without_fft test/unit/test_filters.py::FilterTest::test_apply_chords_axis0 test/unit/test_filters.py::FilterTest::test_apply_chords_axis1 test/unit/test_filters.py::FilterTest::test_apply_chords_axis2 test/unit/test_filters.py::FilterTest::test_apply_chords_with_negative_spacing test/unit/test_filters.py::FilterTest::test_apply_chords_without_trimming test/unit/test_filters.py::FilterTest::test_apply_chords_3D test/unit/test_filters.py::FilterTest::test_flood test/unit/test_filters.py::FilterTest::test_find_disconnected_voxels_2d test/unit/test_filters.py::FilterTest::test_find_disconnected_voxels_2d_conn4 test/unit/test_filters.py::FilterTest::test_find_disconnected_voxels_3d test/unit/test_filters.py::FilterTest::test_find_disconnected_voxels_3d_conn6 test/unit/test_filters.py::FilterTest::test_trim_nonpercolating_paths_2d_axis0 test/unit/test_filters.py::FilterTest::test_trim_nonpercolating_paths_2d_axis1 test/unit/test_filters.py::FilterTest::test_trim_nonpercolating_paths_no_paths test/unit/test_filters.py::FilterTest::test_trim_nonpercolating_paths_3d_axis2 test/unit/test_filters.py::FilterTest::test_trim_nonpercolating_paths_3d_axis1 test/unit/test_filters.py::FilterTest::test_trim_nonpercolating_paths_3d_axis0 test/unit/test_filters.py::FilterTest::test_trim_disconnected_blobs test/unit/test_filters.py::FilterTest::test_fill_blind_pores test/unit/test_filters.py::FilterTest::test_trim_floating_solid test/unit/test_filters.py::FilterTest::test_trim_extrema_min test/unit/test_filters.py::FilterTest::test_trim_extrema_max test/unit/test_filters.py::FilterTest::test_local_thickness test/unit/test_filters.py::FilterTest::test_local_thickness_known_sizes test/unit/test_filters.py::FilterTest::test_porosimetry test/unit/test_filters.py::FilterTest::test_morphology_fft_dilate_2D test/unit/test_filters.py::FilterTest::test_morphology_fft_erode_2D test/unit/test_filters.py::FilterTest::test_morphology_fft_opening_2D test/unit/test_filters.py::FilterTest::test_morphology_fft_closing_2D test/unit/test_filters.py::FilterTest::test_morphology_fft_dilate_3D test/unit/test_filters.py::FilterTest::test_morphology_fft_erode_3D test/unit/test_filters.py::FilterTest::test_morphology_fft_opening_3D test/unit/test_filters.py::FilterTest::test_morphology_fft_closing_3D test/unit/test_filters.py::FilterTest::test_reduce_peaks test/unit/test_filters.py::FilterTest::test_nphase_border_2d_no_diagonals test/unit/test_filters.py::FilterTest::test_nphase_border_2d_diagonals test/unit/test_filters.py::FilterTest::test_nphase_border_3d_no_diagonals test/unit/test_filters.py::FilterTest::test_nphase_border_3d_diagonals test/unit/test_filters.py::FilterTest::test_find_dt_artifacts test/unit/test_filters.py::FilterTest::test_snow_partitioning_n test/unit/test_filters.py::FilterTest::test_chunked_func_2D test/unit/test_filters.py::FilterTest::test_chunked_func_3D test/unit/test_filters.py::FilterTest::test_chunked_func_3D_w_strel test/unit/test_filters.py::FilterTest::test_apply_padded test/unit/test_filters.py::FilterTest::test_trim_small_clusters