Added safety check to GaussianBlur function call