I try to wipe my data and cache partition by flashing an empty image each but instead of a normal factory reset bootup, my phone crashes while initialising the apps. If I use the recovery data/cache wipe option, it works.
Why can't I just replace the image with an empty one, are there more than these two images affected?
UPDATE: Found the solution, the size of the image was too small, I increased it to full partition size. Here is how you get the whole size of a partition: