Fixed error when loading very wide/tall images