horrible if statements to cope with wide pictures