Bug fix: setting extension before loading image from buffer
Loading image from the buffer needs the expected extension to be set in advance. Otherwise, image loading does not know the format and runs into problems.
Loading image from the buffer needs the expected extension to be set in advance. Otherwise, image loading does not know the format and runs into problems.