Fixed issue with reading pixels from loaded images