optimize: set image dimensions to avoid redraws