Added fix for saving captured images