demo: fix image scaling issue where the aspect ratio was not being computed correctly