Resistive solid state sensors are widely used in multiple applications, including molecular and gas detection. The absorption or intercalation of the target species varies the lattice parameters and an effective thickness of thin films, which is usually neglected in the analyses of their transport properties in general and the sensor response in particular. Here, we explore the case of palladium-based thin films absorbing hydrogen and demonstrate that the expansion of thickness is an important mechanism determining the magnitude and the very polarity of the resistance response to hydrogenation in high resistivity films. The model of the resistance response that takes into account the modifications of thickness was tested and confirmed in three Pd-based systems with variable resistivity: thin Pd films above and below the percolation threshold, thick Pd-SiO2 granular composite films with different contents of silica, and Pd-rich CoPd alloys where resistivity depends on the Co concentration. The superposition of the bulk resistivity increase due to hydride formation and the decrease in the film resistance due to the thickness expansion provides a consistent explanation of the hydrogenation response in both continuous and discontinuous films with different structures and compositions.