A bit more compatible with Safari.
Added timeout to preserveAspect to help on iPads.