fixed orientation problem, now there is a problem with the output size