Retain ascpect ratio in resizeImageBase64