Try another attempt for reading framebuffer to memory and code cleanup

Ref #3874