fix error due to corrupted image, error due to empty pot