Added a safe version of imread