Replaced hardcoded 640px values with display width/height