fixed orientation issue and crashes due to out of bound pixels (which are due to the fact that the screen is too small)