High Dynamic Range (HDR) imaging is expected, together with ultra-high definition (UHD) and high frame rate (HFR) video, to become a technology that may change photo, TV, and film industries. Many cameras and displays capable of capturing and rendering both HDR images and video are already available in the market. The popularity and full public adoption of HDR content is however hindered by the lack of standards in evaluation of quality, file formats, and compression, as well as large legacy base of Low Dynamic Range (LDR) displays that are unable to render HDR. To facilitate wide spread of HDR usage, the backward compatibility of HDR with commonly used legacy technologies for storage, rendering, and compression of video and images is necessary. Although many tone-mapping algorithms were developed for generating viewable LDR content from HDR, there is no consensus on which algorithm to use and under which conditions. This paper, via a series of subjective evaluations, demonstrates the dependency of the perceptual quality of the tone-mapped LDR images on the context: environmental factors, display parameters, and image content itself. Based on the results of subjective tests, it proposes to extend JPEG file format, as the most popular image format, in a backward compatible manner to also deal with HDR images. The paper proposes an architecture to achieve such backward compatibility with JPEG. A simple implementation of lossy compression demonstrates the efficiency of the proposed architecture compared to the state of the art HDR image compression.