Fixxed memory overflow and app crashing with new function
decodeAndResizeFile.